Skip to content

Commit

Permalink
Fix the timeout to actually be 15 minutes, not 15 seconds (#57)
Browse files Browse the repository at this point in the history
Signed-off-by: Jeff Kennedy <jeffk@kiva.org>
  • Loading branch information
Jeff Kennedy authored Mar 29, 2021
1 parent 8c503b7 commit 5dae3b1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/db/sms.otp.db.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export class SmsOtpDbGateway {
*/
public saveOtp(did: string, phoneNumber: string, otp: number): Promise<SmsOtp> {
const phoneNumberHash = SecurityUtility.hash32(phoneNumber + process.env.HASH_PEPPER);
const otpExpirationTime = new Date(Date.now() + 15000); // 15 min
const otpExpirationTime = new Date(Date.now() + 900000); // 15 min (15 min * 60 sec * 1000 ms)

This comment has been minimized.

Copy link
@jsaur

jsaur Mar 29, 2021

Contributor

We also have a config you can use instead of hardcoding the number: https://github.com/kiva/aries-key-guardian/blob/master/src/config/env.json#L14

return this.smsOtpRepository.manager.transaction(async (entityManager: EntityManager) => {
const smsOtp: SmsOtp | undefined = await entityManager.findOne(SmsOtp, {
did,
Expand Down

0 comments on commit 5dae3b1

Please sign in to comment.