@daeryun/dr_components 0.9.52 → 0.9.54
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -119,19 +119,26 @@ const LoginContainer = ({ layoutClassName = ' relative h-[100vh] max-h-[1200px]
|
|
|
119
119
|
<button type="button" onClick={() => __awaiter(void 0, void 0, void 0, function* () {
|
|
120
120
|
const testToken = `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjE3NCwiZW1haWwiOiJ0ZXN0Zm9yZGFlcnl1bkBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzUwMjk1NDkyLCJleHAiOjE3ODE4NTMwOTJ9.nqXEF8oMuQpha1Athzb_282Y9J7O5VyvTo67pjeMmLg`;
|
|
121
121
|
const testLogin = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
122
|
-
const res = yield fetch(`${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/api/app/auth/temp?jwt=${testToken}&state=${state}`, {
|
|
122
|
+
const res = yield fetch(`${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/api/lawfirm/app/auth/temp?jwt=${testToken}&state=${state}`, {
|
|
123
123
|
method: 'GET',
|
|
124
|
-
redirect: 'manual', //
|
|
124
|
+
redirect: 'manual', // 리다이렉트를 수동으로 처리
|
|
125
125
|
headers: {
|
|
126
126
|
'Content-Type': 'application/json'
|
|
127
127
|
},
|
|
128
128
|
credentials: 'include'
|
|
129
129
|
});
|
|
130
|
-
if (res.status
|
|
130
|
+
if (res.status >= 300 && res.status < 400) {
|
|
131
131
|
const redirectUrl = res.headers.get('Location');
|
|
132
132
|
if (redirectUrl) {
|
|
133
133
|
window.location.href = redirectUrl;
|
|
134
134
|
}
|
|
135
|
+
else {
|
|
136
|
+
console.warn('Redirect response received, but no Location header found.');
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
const json = yield res.json();
|
|
141
|
+
console.log('No redirect. Response:', json);
|
|
135
142
|
}
|
|
136
143
|
});
|
|
137
144
|
testLogin();
|
|
@@ -173,10 +173,10 @@ const LoginContainer = ({
|
|
|
173
173
|
const testToken = `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjE3NCwiZW1haWwiOiJ0ZXN0Zm9yZGFlcnl1bkBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzUwMjk1NDkyLCJleHAiOjE3ODE4NTMwOTJ9.nqXEF8oMuQpha1Athzb_282Y9J7O5VyvTo67pjeMmLg`;
|
|
174
174
|
const testLogin = async () => {
|
|
175
175
|
const res = await fetch(
|
|
176
|
-
`${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/api/app/auth/temp?jwt=${testToken}&state=${state}`,
|
|
176
|
+
`${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/api/lawfirm/app/auth/temp?jwt=${testToken}&state=${state}`,
|
|
177
177
|
{
|
|
178
178
|
method: 'GET',
|
|
179
|
-
redirect: 'manual', //
|
|
179
|
+
redirect: 'manual', // 리다이렉트를 수동으로 처리
|
|
180
180
|
headers: {
|
|
181
181
|
'Content-Type': 'application/json'
|
|
182
182
|
},
|
|
@@ -184,11 +184,18 @@ const LoginContainer = ({
|
|
|
184
184
|
}
|
|
185
185
|
);
|
|
186
186
|
|
|
187
|
-
if (res.status
|
|
187
|
+
if (res.status >= 300 && res.status < 400) {
|
|
188
188
|
const redirectUrl = res.headers.get('Location');
|
|
189
189
|
if (redirectUrl) {
|
|
190
190
|
window.location.href = redirectUrl;
|
|
191
|
+
} else {
|
|
192
|
+
console.warn(
|
|
193
|
+
'Redirect response received, but no Location header found.'
|
|
194
|
+
);
|
|
191
195
|
}
|
|
196
|
+
} else {
|
|
197
|
+
const json = await res.json();
|
|
198
|
+
console.log('No redirect. Response:', json);
|
|
192
199
|
}
|
|
193
200
|
};
|
|
194
201
|
|