We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40afea8 commit b1da0e4Copy full SHA for b1da0e4
src/auth-strategy.ts
@@ -5,7 +5,7 @@ import {
5
AuthStrategyResult,
6
CollectionSlug,
7
User,
8
- parseCookies,
+ extractJWT,
9
} from "payload";
10
import { PluginOptions } from "./types";
11
@@ -17,8 +17,7 @@ export const createAuthStrategy = (
17
name: pluginOptions.strategyName,
18
authenticate: async ({ headers, payload }): Promise<AuthStrategyResult> => {
19
try {
20
- const cookie = parseCookies(headers);
21
- const token = cookie.get(`${payload.config.cookiePrefix}-token`);
+ const token = extractJWT({ headers, payload })
22
if (!token) return { user: null };
23
24
let jwtUser: JWTPayload | null = null;
0 commit comments