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

Commit

Permalink
🐛 Use email ID to verify, not user ID
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Nov 16, 2020
1 parent 0c2b15b commit 3f9bbae
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/modules/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {
Injectable,
NotFoundException,
UnauthorizedException,
UnprocessableEntityException
UnprocessableEntityException,
} from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { Authenticator } from '@otplib/core';
Expand Down Expand Up @@ -32,7 +32,7 @@ import {
SESSION_NOT_FOUND,
UNVERIFIED_EMAIL,
UNVERIFIED_LOCATION,
USER_NOT_FOUND
USER_NOT_FOUND,
} from '../../errors/errors.constants';
import { safeEmail } from '../../helpers/safe-email';
import { GeolocationService } from '../../providers/geolocation/geolocation.service';
Expand All @@ -47,7 +47,7 @@ import {
LOGIN_ACCESS_TOKEN,
MERGE_ACCOUNTS_TOKEN,
MULTI_FACTOR_TOKEN,
PASSWORD_RESET_TOKEN
PASSWORD_RESET_TOKEN,
} from '../../providers/tokens/tokens.constants';
import { TokensService } from '../../providers/tokens/tokens.service';
import { TwilioService } from '../../providers/twilio/twilio.service';
Expand All @@ -57,7 +57,7 @@ import {
AccessTokenClaims,
MfaTokenPayload,
TokenResponse,
TotpTokenResponse
TotpTokenResponse,
} from './auth.interface';

@Injectable()
Expand Down Expand Up @@ -214,7 +214,7 @@ export class AuthService {
'frontendUrl',
)}/auth/link/verify-email?token=${this.tokensService.signJwt(
EMAIL_VERIFY_TOKEN,
{ id: emailDetails.user.id },
{ id: emailDetails.id },
'7d',
)}`,
},
Expand Down

0 comments on commit 3f9bbae

Please sign in to comment.