Skip oauth for users that are already authenticated. redirect them to '/users/'.
@@ -256,6 +256,10 @@ class OAuthInitializeView(View):
logger.exception()
raise PermissionDenied
+ # If the user has already logged in, let's not spam the OAuth proider.
+ if self.request.user.is_authenticated():
+ return HttpResponseRedirect('/users/')
+ else:
# Get handshaker for the configured wiki oauth URL.
handshaker = _get_handshaker()
logger.info('handshaker gotten')
