Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
🐛 Fix registration, location
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Oct 30, 2020
1 parent 97096b3 commit 99f9058
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/modules/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ export class AuthService {
create: { email: email, emailSafe },
},
},
include: { emails: { select: { id: true } } },
});
await this.prisma.users.update({
where: { id: user.id },
data: { prefersEmail: { connect: { id: user.emails[0]?.id } } },
});
await this.sendEmailVerification(email);
await this.approvedSubnetsService.approveNewSubnet(user.id, ipAddress);
Expand Down
2 changes: 1 addition & 1 deletion src/modules/geolocation/geolocation.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export class GeolocationService implements OnModuleDestroy {
}

private async getUnsafeLocation(ipAddress: string) {
if (this.lookup)
if (!this.lookup)
this.lookup = await geolite2.open<CityResponse>('GeoLite2-City', path => {
return maxmind.open(path);
});
Expand Down

0 comments on commit 99f9058

Please sign in to comment.