From adab4a65a41fce235b48dcf6e26449d6a9d48650 Mon Sep 17 00:00:00 2001 From: LionelB Date: Thu, 4 Jun 2020 12:11:10 +0200 Subject: [PATCH] fix: expiry token --- src/pages/user/new.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pages/user/new.js b/src/pages/user/new.js index 6c0f941f0..64b7a8105 100644 --- a/src/pages/user/new.js +++ b/src/pages/user/new.js @@ -6,6 +6,7 @@ import { withCustomUrqlClient } from "src/hoc/CustomUrqlClient"; import { withAuthProvider } from "src/lib/auth"; import { Alert, jsx } from "theme-ui"; import { useMutation } from "urql"; +import { getExpiryDate } from "src/lib/duration"; const registerUserMutation = ` mutation registerUser($user: auth_users_insert_input! ) { @@ -22,9 +23,8 @@ function prepareMutationData(input) { return { user: { ...input, - secret_token_expires_at: parseInt( - process.env.NEXT_PUBLIC_REFRESH_TOKEN_EXPIRES, - 10 + secret_token_expires_at: getExpiryDate( + parseInt(process.env.NEXT_PUBLIC_ACTIVATION_TOKEN_EXPIRES, 10) ), user_roles: { data: { role: input.default_role } }, },