MCPcopy
hub / github.com/freeCodeCamp/freeCodeCamp / unsign

Function unsign

api/src/plugins/cookies.ts:35–41  ·  view source on GitHub ↗
(rawValue: string)

Source from the content-addressed store, hash-verified

33 * @returns The unsigned cookie value.
34 */
35export const unsign = (rawValue: string): UnsignResult => {
36 const prefix = rawValue.slice(0, 2);
37 if (prefix !== 's:') return { valid: false, renew: false, value: null };
38
39 const value = rawValue.slice(2);
40 return fastifyCookie.unsign(value, COOKIE_SECRET);
41};
42
43/**
44 * Compatibility plugin for using cookies signed by express. By prefixing with

Callers 1

auth0.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected