cleanup internal package resolution

This commit is contained in:
Amruth Pillai
2025-01-13 11:53:42 +01:00
parent 51f38f0884
commit 0f8f2fe560
9 changed files with 66 additions and 60 deletions

View File

@ -30,14 +30,14 @@ export class GitHubStrategy extends PassportStrategy(Strategy, "github") {
let user: User | null = null;
if (!email) throw new BadRequestException();
if (!email) throw new BadRequestException(ErrorMessage.InvalidCredentials);
try {
const user =
(await this.userService.findOneByIdentifier(email)) ??
(username && (await this.userService.findOneByIdentifier(username)));
if (!user) throw new Error("User not found.");
if (!user) throw new Error(ErrorMessage.InvalidCredentials);
done(null, user);
} catch {

View File

@ -30,14 +30,14 @@ export class GoogleStrategy extends PassportStrategy(Strategy, "google") {
let user: User | null = null;
if (!email) throw new BadRequestException();
if (!email) throw new BadRequestException(ErrorMessage.InvalidCredentials);
try {
const user =
(await this.userService.findOneByIdentifier(email)) ??
(username && (await this.userService.findOneByIdentifier(username)));
if (!user) throw new Error("User not found.");
if (!user) throw new Error(ErrorMessage.InvalidCredentials);
done(null, user);
} catch {