Skip to content

Commit 7584d34

Browse files
committed
token is generating
1 parent 764cd8a commit 7584d34

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

api-server/app/auth/controllers/create_token.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ async def create_token(request: TokenRequest, x_exosphere_request_id: str) -> To
2424
try:
2525
logger.info("Finding user", x_exosphere_request_id=x_exosphere_request_id)
2626

27-
user = await User.objects.get(identifier=request.identifier)
27+
user = await User.find_one(User.identifier == request.identifier)
2828

2929
if not user:
3030
logger.error("User not found", x_exosphere_request_id=x_exosphere_request_id)
@@ -39,7 +39,8 @@ async def create_token(request: TokenRequest, x_exosphere_request_id: str) -> To
3939
logger.info("User is a super admin", x_exosphere_request_id=x_exosphere_request_id)
4040

4141
token_claims = {
42-
"user_id": user.id,
42+
"user_id": str(user.id),
43+
"user_name": user.name,
4344
"user_type": user.type,
4445
"verification_status": user.verification_status,
4546
"status": user.status,

0 commit comments

Comments
 (0)