13 lines
249 B
TypeScript
13 lines
249 B
TypeScript
export function sanitizeAuthRedirect(value: string | null | undefined): string | null {
|
|
if (!value) {
|
|
return null;
|
|
}
|
|
if (!value.startsWith("/")) {
|
|
return null;
|
|
}
|
|
if (value.startsWith("//")) {
|
|
return null;
|
|
}
|
|
return value;
|
|
}
|