diff --git a/apps/server/src/auth/strategy/github.strategy.ts b/apps/server/src/auth/strategy/github.strategy.ts index 0f475f45..d6f6398e 100644 --- a/apps/server/src/auth/strategy/github.strategy.ts +++ b/apps/server/src/auth/strategy/github.strategy.ts @@ -34,7 +34,9 @@ export class GitHubStrategy extends PassportStrategy(Strategy, "github") { if (!email) throw new BadRequestException(); try { - const user = await this.userService.findOneByIdentifier(email); + const user = + (await this.userService.findOneByIdentifier(email)) || + (await this.userService.findOneByIdentifier(username)); if (!user) throw new UnauthorizedException();