dev-xo / remix-auth-totp

A Time-Based One-Time Password (TOTP) Authentication Strategy for Remix-Auth.
https://totp.fly.dev
MIT License
415 stars 28 forks source link

[ Question ] Extending OTP Validity Duration #71

Closed 684efs3 closed 2 months ago

684efs3 commented 2 months ago

Is it possible to configure the OTP to remain valid for a longer duration, such as 10 minutes? If so, how can I modify this setting?

dev-xo commented 2 months ago

I think period is what you are looking for @684efs3

/**
 * The number of seconds the OTP will be valid.
 * @default 60 In seconds
 */
authenticator.use(
  new TOTPStrategy(
    {
      secret: TOTP_SECRET,
      totpGeneration: {
        period: 90,
      },
    },
    async ({ email }) => {
      return getUser(email);
    }
  )
)