Skip to content

A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!

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

mradigenb6162d7bb048
diff --git a/apps/server/src/auth/strategy/github.strategy.ts b/apps/server/src/auth/strategy/github.strategy.ts
index 0f475f456..d6f6398e0 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();