Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move out redirect cookie creation so subclasses can reimplement it #49

merged 1 commit into from Oct 14, 2019


Copy link

ananis25 commented Oct 13, 2019

This change allows users to:

  • subclass the GithubAuth class to create an OAuth server compatible with nginx auth_subrequest module (#45 ).
  • rename authentication cookies.


  • replace the redirect-cookie name string with the class attribute for it.
  • move out creation of the asig_redirect cookie so subclasses can implement it differently
@@ -276,7 +276,7 @@ def auth_from_scope(self, scope):
json.dumps(dict(auth, ts=int(time.time())), separators=(",", ":"))

redirect_to = cookies_from_scope(scope).get("asgi_auth_redirect") or "/"
redirect_to = cookies_from_scope(scope).get(self.redirect_cookie_name) or "/"

This comment has been minimized.

Copy link

simonw Oct 14, 2019


Good catch

@simonw simonw merged commit f6a506c into simonw:master Oct 14, 2019

This comment has been minimized.

Copy link

simonw commented Oct 14, 2019

@ananis25 ananis25 deleted the ananis25:edit_redirection branch Oct 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.