Skip to content

Commit 4d844bf

Browse files
authored
Merge pull request #2194 from sopt-makers/feat/#2193
fix: refresh api 호출 안하는 이슈 수정
2 parents 2cba0b0 + b9f5df0 commit 4d844bf

File tree

5 files changed

+66
-21
lines changed

5 files changed

+66
-21
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,15 @@ jobs:
4141
- name: Build
4242
run: yarn build && yarn next export
4343

44+
- name: Prepare deployment package
45+
run: |
46+
mkdir -p deploy
47+
cp -r out/* deploy/
48+
cp -r functions deploy/
49+
4450
- uses: actions/upload-artifact@v4
4551
with:
4652
name: built-app
47-
path: out
53+
path: deploy
4854
if-no-files-found: error
4955
retention-days: 7
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const APPLE_APP_SITE_ASSOCIATION = `{
2+
"applinks": {
3+
"apps": [],
4+
"details": [
5+
{
6+
"appID": "95YWTT5L8K.com.sopt-stamp-iOS.release",
7+
"paths": ["*"]
8+
}
9+
]
10+
}
11+
}`;
12+
13+
export const onRequest: PagesFunction = () => {
14+
return new Response(APPLE_APP_SITE_ASSOCIATION, {
15+
headers: {
16+
'Content-Type': 'application/json',
17+
},
18+
});
19+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const ASSETLINKS_JSON = `[
2+
{
3+
"relation": ["delegate_permission/common.handle_all_urls"],
4+
"target": {
5+
"namespace": "android_app",
6+
"package_name": "org.sopt.official",
7+
"sha256_cert_fingerprints": [
8+
"29:23:1F:E3:7A:FD:76:9C:58:CA:F3:E2:D9:7C:A1:69:CF:04:A8:6E:5B:8A:C6:56:6A:6F:E8:FD:D8:FF:47:43",
9+
"30:8A:35:1F:E1:88:94:6F:BC:E9:B2:D5:FC:2F:9B:F2:10:35:2A:43:B8:36:03:8B:C4:1B:EA:51:23:76:1C:00"
10+
]
11+
}
12+
}
13+
]`;
14+
15+
export const onRequest: PagesFunction = () => {
16+
return new Response(ASSETLINKS_JSON, {
17+
headers: {
18+
'Content-Type': 'application/json',
19+
},
20+
});
21+
};
Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
1-
{\rtf1\ansi\ansicpg1252\cocoartf2822
2-
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\froman\fcharset0 Times-Roman;}
3-
{\colortbl;\red255\green255\blue255;\red0\green0\blue0;}
4-
{\*\expandedcolortbl;;\cssrgb\c0\c0\c0;}
5-
\paperw11900\paperh16840\margl1440\margr1440\vieww11520\viewh8400\viewkind0
6-
\deftab720
7-
\pard\pardeftab720\partightenfactor0
8-
9-
\f0\fs24 \cf0 \expnd0\expndtw0\kerning0
10-
\{\
11-
\'93applinks\'94: \{\
12-
\'93apps\'94: [],\
13-
\'93details\'94: [\
14-
\{\
15-
\'93appID\'94: \'9395YWTT5L8K.com.sopt-stamp-iOS.release\'94,\
16-
\'93paths\'94: [\'93*\'94]\
17-
\}\
18-
]\
19-
\}\
20-
\}}
1+
{
2+
"applinks": {
3+
"apps": [],
4+
"details": [
5+
{
6+
"appID": "95YWTT5L8K.com.sopt-stamp-iOS.release",
7+
"paths": [
8+
"*"
9+
]
10+
}
11+
]
12+
}
13+
}

src/api/index.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ axiosCrewInstance.interceptors.response.use(
8080
);
8181

8282
export const handleTokenError = async (error: AxiosError<unknown>) => {
83+
console.log(error);
8384
const originRequest = error.config;
8485

8586
if (!error.response || !originRequest) throw new Error('에러가 발생했습니다.');
@@ -95,12 +96,17 @@ export const handleTokenError = async (error: AxiosError<unknown>) => {
9596
// 개인정보 처리방침 페이지는 로그인 필요 없음, 구글 정책상 오픈
9697
return Promise.reject(error);
9798
}
99+
// 앱 딥링크를 위한 .well-known 경로는 인증 체크 제외
100+
if (window.location.pathname.startsWith('/.well-known')) {
101+
return Promise.reject(error);
102+
}
98103
/** 토큰이 없으면 refresh 시도하지 않고 바로 intro로 이동 */
99104
const currentToken = tokenStorage.get();
100105
if (currentToken === null && window.location.pathname !== '/intro') {
101106
window.location.replace('/intro');
102107
throw new Error('토큰이 없습니다.');
103108
}
109+
104110
try {
105111
const { data } = await axiosAuthInstance.post<{ data: { accessToken: string } }>(
106112
`/api/v1/auth/refresh/web`,

0 commit comments

Comments
 (0)