Skip to content

Commit

Permalink
Update security.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rimgosu authored Feb 28, 2024
1 parent 58f2f80 commit a8558a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/core/security.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ def create_access_token(data: dict, expires_delta: Optional[timedelta] = None) -
if expires_delta:
expire = datetime.utcnow() + expires_delta
else:
expire = datetime.utcnow() + timedelta(minutes=15) # 예시: 15분 후 만료
expire = datetime.utcnow() + timedelta(minutes=150) # 예시: 15분 후 만료
to_encode.update({"exp": expire})
encoded_jwt = jwt.encode(to_encode, settings.SECRET_KEY, algorithm=settings.ALGORITHM)

expires_in = expires_delta.total_seconds() if expires_delta else 15 * 60 # 예시 값
expires_in = expires_delta.total_seconds() if expires_delta else 150 * 60 # 예시 값

return Token(
access_token=encoded_jwt,
Expand Down Expand Up @@ -96,4 +96,4 @@ async def get_current_user(db: AsyncSession = Depends(get_db), token: str = Depe
user = result.scalars().first()
if user is None:
raise credentials_exception
return user
return user

0 comments on commit a8558a6

Please sign in to comment.