🐛 Fix guest users not merging when sign in (#1542)

This commit is contained in:
Luke Vella 2025-02-03 18:39:04 +07:00 committed by GitHub
parent 0ac1d066ee
commit 5abea1e072
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -255,7 +255,7 @@ const getAuthOptions = (...args: GetServerSessionParams) =>
if (!isInitialSocialLogin) {
// merge guest user into newly logged in user
const session = await getServerSession(...args);
if (session?.user && session.user.email === null) {
if (session?.user && !session.user.email) {
await mergeGuestsIntoUser(user.id, [session.user.id]);
}
}