Feat: Implement Google OAuth using django-allauth for user social authentication#2271
Open
pankaj-basnet wants to merge 3 commits intowger-project:masterfrom
Open
Feat: Implement Google OAuth using django-allauth for user social authentication#2271pankaj-basnet wants to merge 3 commits intowger-project:masterfrom
pankaj-basnet wants to merge 3 commits intowger-project:masterfrom
Conversation
f99bb27 to
32c0e69
Compare
- Add dj-rest-auth to dependencies - Register SocialLoginView for Google OAuth callback via REST - Map dj-rest-auth URLs in wger/urls.py for mobile/headless auth - Maintain compatibility with existing allauth template-based login
Contributor
Author
|
also made demo sample django+react project to show google oauth authentication. https://github.com/pankaj-basnet/Google-oauth-authentication---Django-and-React |
Member
|
there's some tests failing: [1](https://github.com/wger-project/wger/actions/runs/24082190974/job/70245437796?pr=2271#step:8:10742)
File "/home/runner/work/wger/wger/.venv/lib/python3.11/site-packages/allauth/socialaccount/adapter.py", line 212, in get_provider
app = self.get_app(request, provider=provider, client_id=client_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/runner/work/wger/wger/.venv/lib/python3.11/site-packages/allauth/socialaccount/adapter.py", line 302, in get_app
raise SocialApp.DoesNotExist()
allauth.socialaccount.models.SocialApp.DoesNotExistdo we need to register them somehow first? edit: nevermind, just saw in your other repo that we need to run |
Member
|
something else, we should hide this behind a config option, so that this is not shown e.g. in local deployments where it's not used |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Description: This PR implements social authentication using the OAuth 2.0 framework via
django-allauth, specifically configuring the Google provider.Proposed Changes
Related Issue(s)
Actions Performed:
setup_google_oauthcommand correctly populates the allauth'ssocialaccount_socialapptable.