Skip to content
This repository has been archived by the owner on Oct 11, 2024. It is now read-only.

Commit

Permalink
fix(login): revert provider user ID format (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
frgfm authored Mar 1, 2024
1 parent 1e280ce commit 0542e2d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/api/api_v1/endpoints/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from app.core.config import settings
from app.core.security import create_access_token, verify_password
from app.crud import UserCRUD
from app.models import Provider, UserScope
from app.models import UserScope
from app.schemas.login import GHAccessToken, Token, TokenRequest
from app.schemas.services import GHToken
from app.schemas.users import UserCreate
Expand Down Expand Up @@ -85,7 +85,7 @@ async def login_with_github_token(
if gh_user["type"] != "User":
raise HTTPException(status.HTTP_401_UNAUTHORIZED, "GitHub account is expected to be a user")
# Verify credentials
user = await users.get_by("provider_user_id", f"{Provider.GITHUB}|{gh_user['id']}", strict=False)
user = await users.get_by("provider_user_id", gh_user["id"], strict=False)
# Register if non existing
if user is None:
user = await _create_user(UserCreate(provider_user_id=gh_user["id"], scope=UserScope.USER), users) # type: ignore[call-arg]
Expand Down

0 comments on commit 0542e2d

Please sign in to comment.