Skip to content

Commit

Permalink
fix: restore userinfo (#254)
Browse files Browse the repository at this point in the history
- session 没种上
  • Loading branch information
RaoHai authored Aug 22, 2024
2 parents 4870f8d + 7074e09 commit bf88b1b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions server/routers/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from starlette.config import Config
from authlib.integrations.starlette_client import OAuth

from auth.get_user_info import generateAnonymousUser
from auth.get_user_info import generateAnonymousUser, getUserInfoByToken

AUTH0_DOMAIN = get_env_variable("AUTH0_DOMAIN")

Expand Down Expand Up @@ -63,7 +63,8 @@ async def logout(request: Request):
async def callback(request: Request):
print(f"auth_callback: {request.query_params}")
auth0_token = await oauth.auth0.authorize_access_token(request)
user_info = auth0_token.get('userinfo')
user_info = await getUserInfoByToken(token=auth0_token['access_token'])

if user_info:
request.session['user'] = dict(user_info)
data = {
Expand Down

0 comments on commit bf88b1b

Please sign in to comment.