MCPcopy Index your code
hub / github.com/freeCodeCamp/freeCodeCamp / getLoginRedirectParams

Function getLoginRedirectParams

api/src/utils/redirection.ts:150–160  ·  view source on GitHub ↗
(
  req: {
    cookies: Record<string, string | undefined>;
    unsignCookie: (rawValue: string) => { value: string | null };
  },
  _normalizeParams = normalizeParams
)

Source from the content-addressed store, hash-verified

148 * @returns The redirect parameters.
149 */
150export function getLoginRedirectParams(
151 req: {
152 cookies: Record<string, string | undefined>;
153 unsignCookie: (rawValue: string) => { value: string | null };
154 },
155 _normalizeParams = normalizeParams
156): RedirectParams {
157 const signedUrl = req.cookies['login-returnto'];
158 const url = signedUrl ? req.unsignCookie(signedUrl).value : null;
159 return getParamsFromUrl(url, _normalizeParams);
160}
161
162/**
163 * Check if the redirect base and return URL have the same path.

Callers 2

auth0.tsFile · 0.85

Calls 1

getParamsFromUrlFunction · 0.85

Tested by

no test coverage detected