mirror of
https://github.com/AmruthPillai/Reactive-Resume.git
synced 2025-11-12 07:43:10 +10:00
cleanup internal package resolution
This commit is contained in:
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user