Skip to content

Commit

Permalink
fix(cookie): cookie 생성 시 domain 추가 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
mcauto authored and web-flow committed Aug 4, 2020
1 parent c604aa1 commit 3e24ccb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/apps/oauth/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@ async def sign_in(
session.commit()
app_token = create_access_token(google_user_info)
response = RedirectResponse(url=settings.WEB_URI)
response.set_cookie(key="token", value=app_token)
response.set_cookie(
key="token", value=app_token, domain=settings.WEB_URI.host
)
return response
2 changes: 1 addition & 1 deletion src/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Settings(BaseSettings):
PUBLIC_KEY: str = ""
JWT_ALGORITHM: str = "RS256"
SECRET_KEY: str = ""
WEB_URI: str = "https://checkhaebang.com/"
WEB_URI: HttpUrl = "https://checkhaebang.com" # type: ignore
CORS_ALLOWS: List[HttpUrl] = []

ACCESS_TOKEN_EXPIRE_SECONDS: int = 86400 * 7
Expand Down

0 comments on commit 3e24ccb

Please sign in to comment.