From cd44264f657707c1e2a0bdb29a693e9c8ab4aa2c Mon Sep 17 00:00:00 2001 From: pankaj-basnet <165250380+pankaj-basnet@users.noreply.github.com> Date: Tue, 21 Apr 2026 01:45:33 +0545 Subject: [PATCH] feat(oauth): fix url for allauth, removed dj-rest-auth Google, GitHub and Facebook URL patterns from urls.py Removes the conditional URL patterns for /auth/google/ , /auth/github/ and /auth/facebook/ REST endpoints. These will be re-added in a future PR. Also fixes the allauth URL include: use allauth.urls (full set) instead of allauth.socialaccount.urls to resolve the NoReverseMatch error for 'google_login' reported by maintainer rolandgeider. Files changed: - wger/urls.py: remove github/facebook URL blocks, fix allauth.urls include --- wger/urls.py | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/wger/urls.py b/wger/urls.py index 7b0d74bdd..b52b360c4 100644 --- a/wger/urls.py +++ b/wger/urls.py @@ -372,34 +372,16 @@ urlpatterns += [ SpectacularRedocView.as_view(url_name='schema'), name='api-redoc', ), - path('accounts/', include('allauth.account.urls')), ] if settings.WGER_SETTINGS.get('USE_SOCIAL_AUTH', False): urlpatterns += [ - path('accounts/', include('allauth.socialaccount.urls')), - path('auth/registration/', include('dj_rest_auth.registration.urls')), - path('auth/google/', core_api_views.GoogleLogin.as_view(), name='google_rest_login'), + path('accounts/', include('allauth.urls')), + ] +else: + urlpatterns += [ + path('accounts/', include('allauth.account.urls')), ] - - if settings.WGER_SETTINGS.get('USE_GITHUB_AUTH', False): - urlpatterns += [ - path( - 'auth/github/', - core_api_views.GithubLogin.as_view(), - name='github_rest_login', - ), - ] - - # Facebook REST endpoint — only added when Facebook auth is enabled - if settings.WGER_SETTINGS.get('USE_FACEBOOK_AUTH', False): - urlpatterns += [ - path( - 'auth/facebook/', - core_api_views.FacebookLogin.as_view(), - name='facebook_rest_login', - ), - ] # # URL for user uploaded files, served like this during development only