fix: return empty resp if user not exists in login preflight (#5588)

This commit is contained in:
DarkSky
2024-01-13 23:26:55 +08:00
committed by GitHub
parent 5aea84af8f
commit 18907ebe57

View File

@@ -112,6 +112,9 @@ export class UserResolver {
const user = await this.users.findUserByEmail(email);
if (currentUser) return user;
// return empty response when user not exists
if (!user) return null;
// only return limited info when not logged in
return {
email: user?.email,