(request: Request)
| 53 | } |
| 54 | |
| 55 | export async function resolveCookieDomain(request: Request) { |
| 56 | const config = await AppConfig.getConfig(); |
| 57 | const baseUrl = config.auth.baseUrl; |
| 58 | |
| 59 | if (!isUrlAnIp(baseUrl) || isRunningLocally(request)) { |
| 60 | const domain = new URL(request.url).hostname; |
| 61 | if (await AppConfig.isCookieDomainAllowed(domain)) { |
| 62 | return domain; |
| 63 | } |
| 64 | return baseUrl.replace('https://', '').replace('http://', '').split(':')[0]; |
| 65 | } |
| 66 | return ''; |
| 67 | } |
| 68 | |
| 69 | export async function getDataFromRequest( |
| 70 | request: Request, |
no test coverage detected