(redirectTo: string)
| 26 | * Ensures the redirect is not an open redirect, aka it's relative |
| 27 | */ |
| 28 | export const sanitizeRedirect = (redirectTo: string) => { |
| 29 | const sanitizedUrl = new URL(redirectTo, location.origin); |
| 30 | return sanitizedUrl.pathname + sanitizedUrl.search; |
| 31 | }; |
no outgoing calls
no test coverage detected