We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e7d6331 commit c6054c5Copy full SHA for c6054c5
1 file changed
packages/payload/src/auth/operations/me.ts
@@ -38,6 +38,12 @@ export const meOperation = async (args: Arguments): Promise<MeOperationResult> =
38
}
39
40
if (req.user) {
41
+ if (req.user.collection !== collection.config.slug) {
42
+ return {
43
+ user: null!,
44
+ }
45
46
+
47
const { pathname } = req
48
const isGraphQL = pathname === `/api${req.payload.config.routes.graphQL}`
49
@@ -59,12 +65,6 @@ export const meOperation = async (args: Arguments): Promise<MeOperationResult> =
59
65
user._strategy = req.user._strategy
60
66
61
67
62
- if (req.user.collection !== collection.config.slug) {
63
- return {
64
- user: null!,
- }
-
68
// /////////////////////////////////////
69
// me hook - Collection
70
0 commit comments