|
1 | | -/* |
2 | | - * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. |
3 | | - * |
4 | | - * This software may be modified and distributed under the terms |
5 | | - * of the MIT license. See the LICENSE file for details. |
6 | | - */ |
7 | | -import { toCookieHeader } from '@effect/platform/Cookies'; |
8 | | -import { Effect } from 'effect'; |
9 | | -import { RouterBuilder } from 'effect-http'; |
10 | | - |
11 | | -import { CookieService } from '../services/cookie.service.js'; |
12 | | -import { CustomHtmlTemplate } from '../services/custom-html-template.service.js'; |
13 | | -import { apiSpec } from '../spec.js'; |
14 | | - |
15 | | -const customHtmlHandler = RouterBuilder.handler( |
16 | | - apiSpec, |
17 | | - 'PingOneCustomHtml', |
18 | | - ({ headers, query, body }) => |
19 | | - Effect.gen(function* () { |
20 | | - const { handleCustomHtmlTemplate } = yield* CustomHtmlTemplate; |
21 | | - const response = yield* handleCustomHtmlTemplate<typeof headers, typeof query>( |
22 | | - headers, |
23 | | - query, |
24 | | - body, |
25 | | - ); |
26 | | - |
27 | | - const { writeCookie } = yield* CookieService; |
28 | | - |
29 | | - const cookie = yield* writeCookie(headers, response.interactionToken); |
30 | | - |
31 | | - return { |
32 | | - status: 200 as const, |
33 | | - body: response, |
34 | | - headers: { |
35 | | - 'Set-Cookie': toCookieHeader(cookie), |
36 | | - }, |
37 | | - }; |
38 | | - }), |
39 | | -); |
40 | | - |
41 | | -export { customHtmlHandler }; |
| 1 | +// /* |
| 2 | +// * Copyright (c) 2025 Ping Identity Corporation. All rights reserved. |
| 3 | +// * |
| 4 | +// * This software may be modified and distributed under the terms |
| 5 | +// * of the MIT license. See the LICENSE file for details. |
| 6 | +// */ |
| 7 | +// import { toCookieHeader } from '@effect/platform/Cookies'; |
| 8 | +// import { Effect } from 'effect'; |
| 9 | +// import { RouterBuilder } from 'effect-http'; |
| 10 | +// |
| 11 | +// import { CookieService } from '../services/cookie.service.js'; |
| 12 | +// import { CustomHtmlTemplate } from '../services/custom-html-template.service.js'; |
| 13 | +// import { apiSpec } from '../spec.js'; |
| 14 | +// |
| 15 | +// const customHtmlHandler = RouterBuilder.handler( |
| 16 | +// apiSpec, |
| 17 | +// 'PingOneCustomHtml', |
| 18 | +// ({ headers, query, body }) => |
| 19 | +// Effect.gen(function* () { |
| 20 | +// const { handleCustomHtmlTemplate } = yield* CustomHtmlTemplate; |
| 21 | +// const response = yield* handleCustomHtmlTemplate<typeof headers, typeof query>( |
| 22 | +// headers, |
| 23 | +// query, |
| 24 | +// body, |
| 25 | +// ); |
| 26 | +// |
| 27 | +// const { writeCookie } = yield* CookieService; |
| 28 | +// |
| 29 | +// const cookie = yield* writeCookie(headers, response.interactionToken); |
| 30 | +// |
| 31 | +// return { |
| 32 | +// status: 200 as const, |
| 33 | +// body: response, |
| 34 | +// headers: { |
| 35 | +// 'Set-Cookie': toCookieHeader(cookie), |
| 36 | +// }, |
| 37 | +// }; |
| 38 | +// }), |
| 39 | +// ); |
| 40 | +// |
| 41 | +// export { customHtmlHandler }; |
0 commit comments