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

Add Google OAuth Login flow. #459

Merged
merged 11 commits into from
Jul 20, 2023
Merged

Add Google OAuth Login flow. #459

merged 11 commits into from
Jul 20, 2023

Conversation

nsthorat
Copy link
Contributor

@nsthorat nsthorat commented Jul 20, 2023

Demo: https://huggingface.co/spaces/lilacai/nikhil_staging

We use Google login to authenticate the user. This uses the OAuth2 flow where a user clicks /login, redirects to /auth which sets a cookie, and redirects back to the app.

  • Add a login button in the top-left.
  • When in an iframe, pop the user to new tab. This is necessary as we can't set the oauth2 cookie from inside the iframe.

@nsthorat nsthorat changed the title [not read] Add Google OAuth Login flow. Add Google OAuth Login flow. Jul 20, 2023
@nsthorat nsthorat requested a review from dsmilkov July 20, 2023 16:52
Copy link
Collaborator

@dsmilkov dsmilkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very nice!

.env Outdated
# The client secret of the above client.
# GOOGLE_CLIENT_SECRET=
# A random string for oauth sessions.
# LILAC_OAUTH_SECRET_KEY
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: add = at the end for consistency

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -0,0 +1,62 @@
"""Router for tasks."""
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update pydoc

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@nsthorat nsthorat merged commit b762af7 into main Jul 20, 2023
3 checks passed
@nsthorat nsthorat deleted the nik-auth branch July 20, 2023 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants