Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include project code into project authentication token #802

Merged
merged 11 commits into from
Oct 10, 2021
Prev Previous commit
Next Next commit
be sure that project_id was not modified by verify_token
  • Loading branch information
Glandos committed Sep 16, 2021
commit 0a33007adf7b5c506ed84e539589c99beb6a5a8a
7 changes: 5 additions & 2 deletions ihatemoney/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,13 @@ def authenticate(project_id=None):
# Try to get project_id from token first
token = request.args.get("token")
if token:
zorun marked this conversation as resolved.
Show resolved Hide resolved
project_id = Project.verify_token(
verified_project_id = Project.verify_token(
token, token_type="auth", project_id=project_id
)
Glandos marked this conversation as resolved.
Show resolved Hide resolved
token_auth = True
if verified_project_id == project_id:
token_auth = True
else:
project_id = None
else:
token_auth = False
if project_id is None:
Expand Down