Skip to content

Instantly share code, notes, and snippets.

@dkwasniak
Created October 15, 2014 18:42
Show Gist options
  • Save dkwasniak/3ae50f1e22dce966a7a9 to your computer and use it in GitHub Desktop.
Save dkwasniak/3ae50f1e22dce966a7a9 to your computer and use it in GitHub Desktop.

Revisions

  1. dkwasniak created this gist Oct 15, 2014.
    12 changes: 12 additions & 0 deletions gistfile1.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    @psa('social:complete')
    def register_by_access_token(request, backend):
    # This view expects an access_token GET parameter, if it's needed,
    # request.backend and request.strategy will be loaded with the current
    # backend and strategy.
    token = request.GET.get('access_token')
    user = backend.do_auth(request.GET.get('access_token'))
    if user:
    login(request, user)
    return 'OK'
    else:
    return 'ERROR'