@daeryun/dr_components 0.9.51 → 0.9.53
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.
|
@@ -1,4 +1,13 @@
|
|
|
1
1
|
'use client';
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
2
11
|
import React, { useEffect } from 'react';
|
|
3
12
|
import { usePathname, useSearchParams, useRouter } from 'next/navigation';
|
|
4
13
|
import Image from 'next/image';
|
|
@@ -107,9 +116,29 @@ const LoginContainer = ({ layoutClassName = ' relative h-[100vh] max-h-[1200px]
|
|
|
107
116
|
</button>);
|
|
108
117
|
})}
|
|
109
118
|
{isTestLogin && (<div>
|
|
110
|
-
<button type="button" onClick={() => {
|
|
111
|
-
|
|
112
|
-
|
|
119
|
+
<button type="button" onClick={() => __awaiter(void 0, void 0, void 0, function* () {
|
|
120
|
+
const testToken = `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjE3NCwiZW1haWwiOiJ0ZXN0Zm9yZGFlcnl1bkBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzUwMjk1NDkyLCJleHAiOjE3ODE4NTMwOTJ9.nqXEF8oMuQpha1Athzb_282Y9J7O5VyvTo67pjeMmLg`;
|
|
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}`, {
|
|
123
|
+
method: 'GET',
|
|
124
|
+
redirect: 'manual', // 중요!
|
|
125
|
+
headers: {
|
|
126
|
+
'Content-Type': 'application/json'
|
|
127
|
+
},
|
|
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
|
+
}
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
testLogin();
|
|
138
|
+
// router.push(
|
|
139
|
+
// `/api/auth/get-auth?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjE3NCwiZW1haWwiOiJ0ZXN0Zm9yZGFlcnl1bkBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzUwMjk1NDkyLCJleHAiOjE3ODE4NTMwOTJ9.nqXEF8oMuQpha1Athzb_282Y9J7O5VyvTo67pjeMmLg`
|
|
140
|
+
// );
|
|
141
|
+
})} className={`mb-10 flex items-center justify-center rounded-xl border-[1px] border-solid border-gray-200 bg-gray-300 p-2`}>
|
|
113
142
|
<span className={`font-bold`}>{`임시 로그인`}</span>
|
|
114
143
|
</button>
|
|
115
144
|
</div>)}
|
|
@@ -169,10 +169,34 @@ const LoginContainer = ({
|
|
|
169
169
|
<div>
|
|
170
170
|
<button
|
|
171
171
|
type="button"
|
|
172
|
-
onClick={() => {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
172
|
+
onClick={async () => {
|
|
173
|
+
const testToken = `eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjE3NCwiZW1haWwiOiJ0ZXN0Zm9yZGFlcnl1bkBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzUwMjk1NDkyLCJleHAiOjE3ODE4NTMwOTJ9.nqXEF8oMuQpha1Athzb_282Y9J7O5VyvTo67pjeMmLg`;
|
|
174
|
+
const testLogin = async () => {
|
|
175
|
+
const res = await fetch(
|
|
176
|
+
`${process.env.NEXT_PUBLIC_SERVICE_DOMAIN}/api/lawfirm/app/auth/temp?jwt=${testToken}&state=${state}`,
|
|
177
|
+
{
|
|
178
|
+
method: 'GET',
|
|
179
|
+
redirect: 'manual', // 중요!
|
|
180
|
+
headers: {
|
|
181
|
+
'Content-Type': 'application/json'
|
|
182
|
+
},
|
|
183
|
+
credentials: 'include'
|
|
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
|
+
}
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
testLogin();
|
|
196
|
+
|
|
197
|
+
// router.push(
|
|
198
|
+
// `/api/auth/get-auth?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZHgiOjE3NCwiZW1haWwiOiJ0ZXN0Zm9yZGFlcnl1bkBnbWFpbC5jb20iLCJwcm92aWRlciI6Imdvb2dsZSIsImlzTmV3IjpmYWxzZSwiaWF0IjoxNzUwMjk1NDkyLCJleHAiOjE3ODE4NTMwOTJ9.nqXEF8oMuQpha1Athzb_282Y9J7O5VyvTo67pjeMmLg`
|
|
199
|
+
// );
|
|
176
200
|
}}
|
|
177
201
|
className={`mb-10 flex items-center justify-center rounded-xl border-[1px] border-solid border-gray-200 bg-gray-300 p-2`}
|
|
178
202
|
>
|