Anonymous avatar Anonymous committed b9c0501

pass user id with access token

Comments (0)

Files changed (1)

piston/authentication/oauth/views.py

         if form.is_valid() and form.cleaned_data['authorize_access']:
             request_token = store.authorize_request_token(request, oauth_request, request_token)
             if request_token.callback is not None and request_token.callback != 'oob':
-                return HttpResponseRedirect('%s&%s' % (request_token.get_callback_url(), urlencode({'oauth_token': request_token.key, 'user_id': request.user.id})))
+                return HttpResponseRedirect('%s&%s' % (request_token.get_callback_url(), urlencode({'oauth_token': request_token.key})))
             else:
                 return render_to_response(verification_template_name, {'consumer': consumer, 'verification_code': request_token.verifier}, RequestContext(request))
     else:
     access_token = store.create_access_token(request, oauth_request, consumer, request_token)
 
     ret = urlencode({
+        'user_id': access_token.user_id,
         'oauth_token': access_token.key,
         'oauth_token_secret': access_token.secret
     })
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.