Skip to content

Commit

Permalink
Fixed issue with str user_id
Browse files Browse the repository at this point in the history
  • Loading branch information
vsdudakov committed Apr 22, 2023
1 parent f618ac9 commit e71836c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fastadmin/api/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,11 @@ async def sign_in(

now = datetime.utcnow()
session_expired_at = now + timedelta(seconds=settings.ADMIN_SESSION_EXPIRED_AT)
if isinstance(user_id, UUID):
user_id = str(user_id)
return jwt.encode(
{
"user_id": str(user_id),
"user_id": user_id,
"session_expired_at": session_expired_at.isoformat(),
},
settings.ADMIN_SECRET_KEY,
Expand Down

0 comments on commit e71836c

Please sign in to comment.