Skip to content

Commit e6971da

Browse files
committed
Fix reverse call in authenticate(). Same solution as #170
1 parent 229e552 commit e6971da

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

rest_framework_social_oauth2/authentication.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from social_core.exceptions import MissingBackend
1414
from social_core.utils import requests
1515

16+
from .settings import DRFSO2_URL_NAMESPACE
17+
1618

1719
class SocialAuthentication(BaseAuthentication):
1820
"""
@@ -54,7 +56,7 @@ def authenticate(self, request):
5456
strategy = load_strategy(request=request)
5557

5658
try:
57-
backend = load_backend(strategy, backend, reverse(NAMESPACE + ":complete", args=(backend,)))
59+
backend = load_backend(strategy, backend, reverse("%s:%s:complete" % (DRFSO2_URL_NAMESPACE, NAMESPACE), args=(backend,)))
5860
except MissingBackend:
5961
msg = 'Invalid token header. Invalid backend.'
6062
raise exceptions.AuthenticationFailed(msg)

0 commit comments

Comments
 (0)