|
1 | 1 | import * as bcrypt from 'bcryptjs';
|
2 | 2 | import * as jwt from 'jsonwebtoken';
|
3 | 3 | import * as validator from 'validator';
|
4 |
| -import * as uuidv4 from 'uuid/v4'; |
| 4 | +import { v4 as uuid } from 'uuid'; |
5 | 5 | import { getUser, Context } from './utils';
|
6 | 6 | import { User } from './Adapter';
|
7 | 7 | import {
|
@@ -96,7 +96,7 @@ export const mutations = {
|
96 | 96 |
|
97 | 97 | validatePassword(data.password);
|
98 | 98 | const hashedPassword = await getHashedPassword(data.password);
|
99 |
| - const emailConfirmToken = uuidv4(); |
| 99 | + const emailConfirmToken = uuid(); |
100 | 100 |
|
101 | 101 | const newUser = await ctx.graphqlAuthentication.adapter.createUserBySignup(
|
102 | 102 | ctx,
|
@@ -266,7 +266,7 @@ export const mutations = {
|
266 | 266 | // This token will be used in the email to the user.
|
267 | 267 | // According to https://gist.github.com/joepie91/7105003c3b26e65efcea63f3db82dfba
|
268 | 268 | // uuid v4 is safe to be used as random token generator.
|
269 |
| - const inviteToken = uuidv4(); |
| 269 | + const inviteToken = uuid(); |
270 | 270 |
|
271 | 271 | const newUser = await ctx.graphqlAuthentication.adapter.createUserByInvite(
|
272 | 272 | ctx,
|
@@ -327,7 +327,7 @@ export const mutations = {
|
327 | 327 | // This token will be used in the email to the user.
|
328 | 328 | // According to https://gist.github.com/joepie91/7105003c3b26e65efcea63f3db82dfba
|
329 | 329 | // uuid v4 is safe to be used as random token generator.
|
330 |
| - const resetToken = uuidv4(); |
| 330 | + const resetToken = uuid(); |
331 | 331 | const now = new Date();
|
332 | 332 | // Expires in two hours
|
333 | 333 | const resetExpires = new Date(now.getTime() + 7200000).toISOString();
|
|
0 commit comments