fix(github_auth): fix GithubStrategy not searching for user using username

This commit is contained in:
mradigen
2024-03-06 15:40:37 +05:30
parent 550e15228e
commit b6162d7bb0

View File

@ -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();