Skip to content

Commit

Permalink
fix: new user auth
Browse files Browse the repository at this point in the history
  • Loading branch information
RaoHai committed Dec 27, 2024
1 parent bc52d80 commit d95ea7b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions server/auth/router.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ async def callback(request: Request, auth_client: BaseAuthClient = Depends(get_a
if user_info:
upsert_user = {
**user_info,
'agreement_accepted': profile['agreement_accepted'],
'is_admin': profile['is_admin'],
'agreement_accepted': profile['agreement_accepted'] if profile else False,
'is_admin': profile['is_admin'] if profile else False,
}

request.session["user"] = dict(upsert_user)
Expand Down
2 changes: 1 addition & 1 deletion server/core/dao/profilesDAO.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def get_profile(self, user_id: str):
.eq('id', user_id)
.execute()
)
return resp.data[0]
return resp.data[0] if resp.data else None

Check warning on line 21 in server/core/dao/profilesDAO.py

View check run for this annotation

Codecov / codecov/patch

server/core/dao/profilesDAO.py#L21

Added line #L21 was not covered by tests

def get_agreement_status(self, user_id: str):

Expand Down

0 comments on commit d95ea7b

Please sign in to comment.