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

fix(login): revert provider user ID format #112

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
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)

Check warning on line 88 in src/app/api/api_v1/endpoints/login.py

View check run for this annotation

Codecov / codecov/patch

src/app/api/api_v1/endpoints/login.py#L88

Added line #L88 was not covered by tests
# 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
Loading