cozy

  • 홈
  • 태그
  • 방명록

2023/05/02 1

[FastAPI] 쿠키 설정 및 쿠키 삭제

FastAPI 프로젝트에서 회원가입 및 로그인을 하면 토큰을 발행하게 되어 있다. 로그인 시에 해당 토큰을 프론트에 리턴하기 전에 쿠키에 설정하고, 또한 로그아웃 시에 쿠키를 삭제하는 로직을 추가하려고 한다. 로그인 코드 및 set_cookie async def login( req: UserLoginReqDto, response: Response ): email = req.email password = req.password user = await get_user_by_email(email) if not user: raise HTTPException( status_code=status.HTTP_400_BAD_REQUEST, detail="User does not exist", ) hashed_passwo..

FastAPI 2023.05.02
이전
1
다음
더보기
프로필사진

cozy

  • 분류 전체보기
    • Python
    • Django
    • FastAPI
    • Docker
    • Database

Tag

django, wecode, set_cookie, 믹스패널, corsheaders, List comprehensions, refactoring, Pydantic, API Testing, first class citizen, Til, Django 초기 세팅, Python, nested function, FastAPI, 일급객체, delete_cookie, Mixpanel, drf, token authentication,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2023/05   »
일 월 화 수 목 금 토
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31

방문자수Total

  • Today :
  • Yesterday :

Copyright © AXZ Corp. All rights reserved.

티스토리툴바