support delete account

This commit is contained in:
miloschwartz
2026-02-14 17:27:51 -08:00
parent e6a5cef945
commit 33f0782f3a
13 changed files with 963 additions and 192 deletions

View File

@@ -41,11 +41,12 @@ export function consumeInternalRedirectPath(): string | null {
}
/**
* Returns the full redirect target for an org: either `/${orgId}` or
* `/${orgId}${path}` if a valid internal_redirect was stored. Consumes the
* stored value.
* Returns the full redirect target if a valid internal_redirect was stored
* (consumes the stored value). Returns null if none was stored or expired.
* Paths starting with /auth/ are returned as-is; others are prefixed with orgId.
*/
export function getInternalRedirectTarget(orgId: string): string {
export function getInternalRedirectTarget(orgId: string): string | null {
const path = consumeInternalRedirectPath();
return path ? `/${orgId}${path}` : `/${orgId}`;
if (!path) return null;
return path.startsWith("/auth/") ? path : `/${orgId}${path}`;
}