Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .env.production

This file was deleted.

6 changes: 6 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ jobs:
node-version: 20
cache: pnpm

- name: Create .env file
run: |
echo "VITE_API_BASE_URL=${{ secrets.VITE_API_BASE_URL }}" >> .env
echo "VITE_NAVER_AES_SECRET=${{ secrets.VITE_NAVER_AES_SECRET }}" >> .env
echo "VITE_NAVER_AES_IV=${{ secrets.VITE_NAVER_AES_IV }}" >> .env

- name: Install dependencies
run: pnpm install --frozen-lockfile

Expand Down
2 changes: 1 addition & 1 deletion src/hooks/auth/useTokenRefresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const useTokenRefresh = () => {
const initAuth = async () => {
try {
const { data } = await reissueToken();
if (data.accessToken) {
if (data?.accessToken) {
setAccessToken(data.accessToken);
}
} catch {
Expand Down
3 changes: 2 additions & 1 deletion src/lib/axiosInstance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ axiosInstance.interceptors.response.use(
try {
const { data } = await authInstance.post("/api/auth/reissue");

const newAccessToken = data.data.accessToken;
const newAccessToken = data.data?.accessToken;
if (!newAccessToken) throw new Error("토큰 재발급 실패");

useAuthStore.getState().setAccessToken(newAccessToken);
onRefreshed(newAccessToken);
Expand Down
1 change: 1 addition & 0 deletions src/store/useAuthStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const useAuthStore = create<IAuthState>((set) => ({
localStorage.removeItem("hasSession");
set({
isLoggedIn: false,
isTokenInitialized: false,
accessToken: null,
email: "",
socialId: null,
Expand Down
Loading