Skip to content

Commit

Permalink
fix: expiry token
Browse files Browse the repository at this point in the history
  • Loading branch information
lionelB committed Jun 4, 2020
1 parent ee0cecb commit adab4a6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pages/user/new.js
Expand Up @@ -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! ) {
Expand All @@ -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 } },
},
Expand Down

0 comments on commit adab4a6

Please sign in to comment.