Skip to content

Commit

Permalink
fix: new user auth (#622)
Browse files Browse the repository at this point in the history
- 修复新增用户的问题
  • Loading branch information
RaoHai authored Dec 27, 2024
2 parents 8836f1c + d95ea7b commit a95633e
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

def get_agreement_status(self, user_id: str):

Expand Down

0 comments on commit a95633e

Please sign in to comment.