fcs
2025-04-10 0163870d662dc5b7d69ceff977490ede594f7d82
1
2
3
4
5
6
7
8
9
10
11
12
/**
 * resolveCookies - Attempts to retrieve the token from a cookie
 *
 * This function uses the opts.cookie option to retrieve the token
 *
 * @param {Object}        ctx  The ctx object passed to the middleware
 * @param {Object}        opts This middleware's options
 * @return {String|null|undefined}  The resolved token or null if not found or undefined if opts.cookie is not set
 */
module.exports = function resolveCookies(ctx, opts) {
    return opts.cookie && ctx.cookies.get(opts.cookie);
};