Skip to content
Snippets Groups Projects
Commit eb8dfa82 authored by jan.bednarik's avatar jan.bednarik
Browse files

Fix JWT parsing

parent 04793808
No related branches found
No related tags found
No related merge requests found
Pipeline #5541 passed
...@@ -284,7 +284,7 @@ class LoginRedirectView(View): ...@@ -284,7 +284,7 @@ class LoginRedirectView(View):
token = request.GET.get("token") token = request.GET.get("token")
# get cookie max_age from token # get cookie max_age from token
payload = jwt.decode(token, verify=False) payload = jwt.decode(token, algorithms=[settings.JWT_ALGORITHM], verify=False)
max_age = payload["exp"] - time.time() max_age = payload["exp"] - time.time()
response = HttpResponseRedirect(reverse("account")) response = HttpResponseRedirect(reverse("account"))
......
...@@ -114,3 +114,6 @@ OPENLOBBY_API_URL = f"{openlobby_server_dsn}/graphql" ...@@ -114,3 +114,6 @@ OPENLOBBY_API_URL = f"{openlobby_server_dsn}/graphql"
APP_URL = os.environ.get("APP_URL", "http://localhost:8020") APP_URL = os.environ.get("APP_URL", "http://localhost:8020")
ACCESS_TOKEN_COOKIE = "ol_access_token" ACCESS_TOKEN_COOKIE = "ol_access_token"
# signature algorithm JSON Web Tokens
JWT_ALGORITHM = "HS512"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment