1
0
Fork 0

Add missing login URL when using social auth

Signed-off-by: Vasilis Tsiligiannis <acinonyx@openwrt.gr>
merge-requests/778/head
Vasilis Tsiligiannis 2019-09-28 13:47:18 +03:00
parent 8084263697
commit 06da2b8cca
1 changed files with 5 additions and 1 deletions

View File

@ -2,7 +2,7 @@ import requests
from social_core.backends.oauth import BaseOAuth2
class Auth0(BaseOAuth2): # pylint: disable=W0223
class Auth0(BaseOAuth2):
"""Auth0 OAuth authentication backend"""
name = 'auth0'
SCOPE_SEPARATOR = ' '
@ -17,6 +17,10 @@ class Auth0(BaseOAuth2): # pylint: disable=W0223
"""Return the token endpoint."""
return "https://" + self.setting('DOMAIN') + "/oauth/token"
def auth_html(self):
"""Return the login endpoint."""
return "https://" + self.setting('DOMAIN') + "/login/auth0"
def get_user_id(self, details, response):
"""Return current user id."""
return details['user_id']