Skip to content

Commit ba5684f

Browse files
committed
took out dev comments
1 parent 716f797 commit ba5684f

2 files changed

Lines changed: 0 additions & 9 deletions

File tree

src/app/api/v1/oauth.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,6 @@ async def _callback_handler(self, request: Request, response: Response, db: Asyn
9393
return {"access_token": access_token, "token_type": "bearer"}
9494

9595
async def _get_user_details(self, oauth_user: OpenID) -> UserCreateInternal:
96-
"""Get user details from the OAuth provider response.
97-
98-
The exact details exposed by the OpenID class can be found here:
99-
https://github.com/tomasvotava/fastapi-sso/blob/master/fastapi_sso/sso/base.py#L64
100-
"""
10196
if not oauth_user.email:
10297
raise UnauthorizedException(f"Invalid response from {self.provider_name.title()} OAuth.")
10398
username = oauth_user.email.split("@")[0]

src/app/api/v1/users.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,6 @@ async def write_user_internal(user: UserCreate | UserCreateInternal, db: AsyncSe
4242
user_internal_dict["hashed_password"] = get_password_hash(password=user_internal_dict["password"])
4343
del user_internal_dict["password"]
4444
user = UserCreateInternal(**user_internal_dict)
45-
elif isinstance(user, UserCreateInternal) and user.hashed_password is None:
46-
# NULL passwords are only allowed for OAuth users (UserCreateInternal from OAuth flow)
47-
# This is validated here to prevent any other code path from creating passwordless users
48-
pass
4945

5046
created_user = await crud_users.create(db=db, object=user, schema_to_select=UserRead)
5147
if created_user is None:

0 commit comments

Comments
 (0)