-
Notifications
You must be signed in to change notification settings - Fork 0
Auth API
์ ์ฌ์ฉ์๋ฅผ ํ์๊ฐ์ ์ฒ๋ฆฌํฉ๋๋ค.
{
"email": "[email protected]",
"password": "P@ssw0rd!",
"nickName": "Beemo",
"phoneNumber": "010-1234-5678"
}{
"id": 1,
"email": "[email protected]",
"nickName": "Beemo",
"phoneNumber": "010-1234-5678",
"createdAt": "2025-01-30T12:00:00"
}๋น๋ฐ๋ฒํธ๋ ์๋ต์ ํฌํจํ์ง ์์ต๋๋ค.
์ด๋ฉ์ผ๊ณผ ๋น๋ฐ๋ฒํธ๋ก ๋ก๊ทธ์ธํ๊ณ JWT ํ ํฐ์ ๋ฐ๊ธ๋ฐ์ต๋๋ค.
{
"email": "[email protected]",
"password": "P@ssw0rd!"
}{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"tokenType": "Bearer",
"expiresIn": 3600, //1์๊ฐ
"user": {...}
}Set-Cookie: refreshToken={value}; Max-Age=604800; Expires=Sun, 14 Dec YYYY HH:MM:SS GMT; Path=/; Secure; HttpOnly; SameSite=Strict
-
refreshToken์ ๊ฒฝ์ฐ HttpOnly Cookie๋ก ๋ณ๊ฒฝ๋์์ต๋๋ค. -
accessToken: ์ดํ ์์ฒญ ์Authorization: Bearer {accessToken}ํค๋์ ๋ฃ์ด ์ฌ์ฉ -
tokenType: ๋ณดํต"Bearer"๊ณ ์ -
expiresIn: access token ๋ง๋ฃ ์๊ฐ(์ด ๋จ์, ๋ณ๊ฒฝ ๊ฐ๋ฅ) -
user: ๋ก๊ทธ์ธํ ์ฌ์ฉ์ ๊ธฐ๋ณธ ์ ๋ณด
ํ์ฌ ๋ก๊ทธ์ธ๋ ์ฌ์ฉ์์ Refresh Token์ ๋ฌดํจํํ๊ณ , ์ธ์ ์ ์ข ๋ฃํฉ๋๋ค.
refreshToken
๋ฆฌํ๋ ์ ํ ํฐ ์ธ์ฆ์ ํตํด ์์ธ์ค ํ ํฐ ์ฌ๋ฐ๊ธํฉ๋๋ค.
refreshToken
{
"accessToken": "eyJhbGciOiJIUzI1NiJ9....",
"tokenType": "Bearer",
"expiresIn": 3600,
"expiresAt": "2025-12-07T20:55:10.113808"
}