Skip to content

Commit de1fe50

Browse files
committed
Replaced 'uuid' by randomUUID() from 'crypto' - post rebase
1 parent 7a4f333 commit de1fe50

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

src/auth/auth.token.generator.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
'use strict';
22

33
const jwt = require('jsonwebtoken');
4-
const { v4: uuid } = require('uuid');
4+
// Minimum supported version is Node 14.17.0, which has the "randomUUID" method in the crypto module
5+
// eslint-disable-next-line n/no-unsupported-features/node-builtins
6+
const { randomUUID } = require('crypto');
57
const superagent = require('superagent');
68
const Validation = require('../yoti_common/validation');
79
const config = require('../../config');
@@ -71,7 +73,7 @@ class AuthTokenGenerator {
7173
aud: this.authUrl,
7274
iat: now,
7375
exp: now + 300,
74-
jti: uuid(),
76+
jti: randomUUID(),
7577
},
7678
this.pem.toString(),
7779
{ algorithm: 'PS384' }

src/auth/signed.request.strategy.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
'use strict';
22

3-
const { v4: uuid } = require('uuid');
3+
// Minimum supported version is Node 14.17.0, which has the "randomUUID" method in the crypto module
4+
// eslint-disable-next-line n/no-unsupported-features/node-builtins
5+
const { randomUUID } = require('crypto');
46
const yotiCommon = require('../yoti_common');
57
const Validation = require('../yoti_common/validation');
68

@@ -40,7 +42,7 @@ class SignedRequestStrategy {
4042
// eslint-disable-next-line class-methods-use-this
4143
createQueryParams() {
4244
return {
43-
nonce: uuid(),
45+
nonce: randomUUID(),
4446
timestamp: Date.now(),
4547
};
4648
}

0 commit comments

Comments
 (0)