(
req: {
cookies: Record<string, string | undefined>;
unsignCookie: (rawValue: string) => { value: string | null };
},
_normalizeParams = normalizeParams
)
| 148 | * @returns The redirect parameters. |
| 149 | */ |
| 150 | export function getLoginRedirectParams( |
| 151 | req: { |
| 152 | cookies: Record<string, string | undefined>; |
| 153 | unsignCookie: (rawValue: string) => { value: string | null }; |
| 154 | }, |
| 155 | _normalizeParams = normalizeParams |
| 156 | ): RedirectParams { |
| 157 | const signedUrl = req.cookies['login-returnto']; |
| 158 | const url = signedUrl ? req.unsignCookie(signedUrl).value : null; |
| 159 | return getParamsFromUrl(url, _normalizeParams); |
| 160 | } |
| 161 | |
| 162 | /** |
| 163 | * Check if the redirect base and return URL have the same path. |
no test coverage detected