Sveltekit 과 Express 를 이용한 JWT 인증 프로젝트
clientSveltekitAPI serverExpress
clientLogin- error message #1
-
axios request interceptor: appendAuthenticationheaderauth-fetchmiddleware with native fetch
-
axios response interceptor:auth-fetchmiddleware with native fetch- accessToken expired, re-generate Token with refreshToken
- re-try original request with renewed Token
serverLogin Process- validate credential #1
- generate accessToken, refreshToken
- authentication middleware
- authorized router (
/api/user) - token refresh router
sveltekitcustomauth-fetchmiddleware instead ofauthorize hooks