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

Handle facebook limited login #113

Merged
merged 8 commits into from
Jan 8, 2025
5 changes: 5 additions & 0 deletions src/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,11 @@ def oauth_fb(request: Request) -> ResponseType:
),
401,
)
if account != user.get("id"):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me like we need instead, in line 386, something like this:

account_in_token = decoded_token.get("sub", "")
if account_in_token != account:
    return (jsonify(...), 401)  # User account mismatch

We already assigned the account variable in line 326 and the user id in the token ("sub") must match that account id.

return (
jsonify({"status": "invalid", "msg": "Wrong user id in Facebook token"}),
401,
)
else:
# Validate regular Facebook token
r = requests.get(
Expand Down