From 6b4d07154ebd32574024e93913469568acdf08bc Mon Sep 17 00:00:00 2001 From: ligong Date: Sun, 7 Jun 2026 14:12:37 +0800 Subject: [PATCH 1/2] fix: allow existing users to sign in and link via oauth --- src/core/protocols/oauth/oauth_authentication.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/protocols/oauth/oauth_authentication.ts b/src/core/protocols/oauth/oauth_authentication.ts index 8ae77f3..4556974 100644 --- a/src/core/protocols/oauth/oauth_authentication.ts +++ b/src/core/protocols/oauth/oauth_authentication.ts @@ -51,9 +51,8 @@ async function _createUser({ email, name, collections, request, allowOAuthAutoSi data, returning: true }) - } else { - return null - } + } + return userRecord } export async function OAuthAuthentication( From 2626e19bc5094f9d07b1c4fa6e3a85193d42a0df Mon Sep 17 00:00:00 2001 From: ligong Date: Sun, 7 Jun 2026 14:19:46 +0800 Subject: [PATCH 2/2] chore: add changeset --- .changeset/fair-lobsters-teach.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/fair-lobsters-teach.md diff --git a/.changeset/fair-lobsters-teach.md b/.changeset/fair-lobsters-teach.md new file mode 100644 index 0000000..10d24a5 --- /dev/null +++ b/.changeset/fair-lobsters-teach.md @@ -0,0 +1,5 @@ +--- +"payload-auth-plugin": patch +--- + +Allow existing users to sign in and link via OAuth by returning the existing user record instead of null in \_createUser.