Skip to content

Commit

Permalink
fix: Make Login Session (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: SeoJimin <jnuni004@naver.com>
  • Loading branch information
SeoJimin1234 and SeoJimin authored Jan 6, 2024
1 parent 8a5399a commit ca9efa5
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions UpcyProject/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
https://docs.djangoproject.com/en/4.0/ref/settings/
"""

from datetime import timedelta
from pathlib import Path
import environ
import os
Expand Down Expand Up @@ -71,6 +72,30 @@

AUTH_USER_MODEL = "users.User"

ACCOUNT_USER_MODEL_USERNAME_FIELD = None
ACCOUNT_EMAIL_REQUIRED = True
ACCOUNT_USERNAME_REQUIRED = False
ACCOUNT_AUTHENTICATION_METHOD = 'email'

REST_FRAMEWORK = {
"DEFAULT_PERMISSION_CLASSES": ["rest_framework.permissions.IsAuthenticated", ],
"DEFAULT_AUTHENTICATION_CLASSES": [
"rest_framework_simplejwt.authentication.JWTAuthentication",
"rest_framework.authentication.TokenAuthentication",
"rest_framework.authentication.SessionAuthentication",
],
}

REST_USE_JWT = True

SIMPLE_JWT = {
'ACCESS_TOKEN_LIFETIME': timedelta(minutes=10),
'REFRESH_TOKEN_LIFETIME': timedelta(days=28),
'ROTATE_REFRESH_TOKENS': False, # true면 토큰 갱신 시 refresh도 같이 갱신
'BLACKLIST_AFTER_ROTATION': True,
}


ROOT_URLCONF = 'UpcyProject.urls'

TEMPLATES = [
Expand Down

0 comments on commit ca9efa5

Please sign in to comment.