Skip to content

takeTokenFromUrl

function takeTokenFromUrl(location, replace): string | null;

Defined in: src/ui/token.ts:15

Read a portal token from #token= (preferred) or ?token=, and strip it from the URL through replace (e.g. (url) => history.replaceState(null, "", url)). Other query and hash parameters are kept. Returns the token, or null when the URL carries none (nothing is replaced then).

Parameter Type
location Pick<Location, "hash" | "search" | "pathname">
replace (url) => void

string | null