mirror of
https://github.com/wger-project/wger.git
synced 2026-12-05 04:57:52 +01:00
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
This commit is contained in:
committed by
Roland Geider
parent
e4bc965374
commit
cd44264f65
28
wger/urls.py
28
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
|
||||
|
||||
Reference in New Issue
Block a user