comingBack

tcmts.registry.session.comingBack · #annvfn6d · term · runs anywhere

Where to go back to after signing in: the page it started from, if it's a path of this site (not //elsewhere nor /\elsewhere, which a browser takes for another site), else fallback.

export const comingBack = (kept: string | null, fallback: string): string =>
  kept && /^\/(?![/\\])/.test(kept) ? kept : fallback

used by