@daeryun/dr_components 0.9.54 → 0.9.55
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,26 +119,17 @@ 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
|
|
122
|
+
const result = yield fetch(`${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/api/lawfirm/app/auth/temp?jwt=${testToken}&state=${state}`, {
|
|
123
123
|
method: 'GET',
|
|
124
124
|
redirect: 'manual', // 리다이렉트를 수동으로 처리
|
|
125
125
|
headers: {
|
|
126
126
|
'Content-Type': 'application/json'
|
|
127
127
|
},
|
|
128
128
|
credentials: 'include'
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
window.location.href = redirectUrl;
|
|
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);
|
|
129
|
+
}).then(obj => obj.json());
|
|
130
|
+
console.log('result', result);
|
|
131
|
+
if (result === null || result === void 0 ? void 0 : result.result) {
|
|
132
|
+
window.location.href = `${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/api/auth/get-auth?jwt=${testToken}`;
|
|
142
133
|
}
|
|
143
134
|
});
|
|
144
135
|
testLogin();
|
|
@@ -172,7 +172,7 @@ const LoginContainer = ({
|
|
|
172
172
|
onClick={async () => {
|
|
173
173
|
const testToken = `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjE3NCwiZW1haWwiOiJ0ZXN0Zm9yZGFlcnl1bkBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzUwMjk1NDkyLCJleHAiOjE3ODE4NTMwOTJ9.nqXEF8oMuQpha1Athzb_282Y9J7O5VyvTo67pjeMmLg`;
|
|
174
174
|
const testLogin = async () => {
|
|
175
|
-
const
|
|
175
|
+
const result = await fetch(
|
|
176
176
|
`${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/api/lawfirm/app/auth/temp?jwt=${testToken}&state=${state}`,
|
|
177
177
|
{
|
|
178
178
|
method: 'GET',
|
|
@@ -182,20 +182,10 @@ const LoginContainer = ({
|
|
|
182
182
|
},
|
|
183
183
|
credentials: 'include'
|
|
184
184
|
}
|
|
185
|
-
);
|
|
186
|
-
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
if (redirectUrl) {
|
|
190
|
-
window.location.href = redirectUrl;
|
|
191
|
-
} else {
|
|
192
|
-
console.warn(
|
|
193
|
-
'Redirect response received, but no Location header found.'
|
|
194
|
-
);
|
|
195
|
-
}
|
|
196
|
-
} else {
|
|
197
|
-
const json = await res.json();
|
|
198
|
-
console.log('No redirect. Response:', json);
|
|
185
|
+
).then(obj => obj.json());
|
|
186
|
+
console.log('result', result);
|
|
187
|
+
if (result?.result) {
|
|
188
|
+
window.location.href = `${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/api/auth/get-auth?jwt=${testToken}`;
|
|
199
189
|
}
|
|
200
190
|
};
|
|
201
191
|
|