@daeryun/dr_components 0.9.53 → 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,19 +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 res = yield fetch(`${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/api/lawfirm/app/auth/temp?jwt=${testToken}&state=${state}`, {
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
- redirect: 'manual', // 중요!
124
+ redirect: 'manual', // 리다이렉트를 수동으로 처리
125
125
  headers: {
126
126
  'Content-Type': 'application/json'
127
127
  },
128
128
  credentials: 'include'
129
- });
130
- if (res.status === 302 || res.status === 301) {
131
- const redirectUrl = res.headers.get('Location');
132
- if (redirectUrl) {
133
- window.location.href = redirectUrl;
134
- }
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}`;
135
133
  }
136
134
  });
137
135
  testLogin();
@@ -172,23 +172,20 @@ const LoginContainer = ({
172
172
  onClick={async () => {
173
173
  const testToken = `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjE3NCwiZW1haWwiOiJ0ZXN0Zm9yZGFlcnl1bkBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzUwMjk1NDkyLCJleHAiOjE3ODE4NTMwOTJ9.nqXEF8oMuQpha1Athzb_282Y9J7O5VyvTo67pjeMmLg`;
174
174
  const testLogin = async () => {
175
- const res = await fetch(
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',
179
- redirect: 'manual', // 중요!
179
+ redirect: 'manual', // 리다이렉트를 수동으로 처리
180
180
  headers: {
181
181
  'Content-Type': 'application/json'
182
182
  },
183
183
  credentials: 'include'
184
184
  }
185
- );
186
-
187
- if (res.status === 302 || res.status === 301) {
188
- const redirectUrl = res.headers.get('Location');
189
- if (redirectUrl) {
190
- window.location.href = redirectUrl;
191
- }
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}`;
192
189
  }
193
190
  };
194
191