[GH-ISSUE #1030] Bug: otpExpiry in emailOTP does not work + error in docs #8558

Closed
opened 2026-04-13 03:40:36 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @JosipPardon on GitHub (Dec 27, 2024).
Original GitHub issue: https://github.com/better-auth/better-auth/issues/1030

Is this suited for github?

  • Yes, this is suited for github

To Reproduce

export const auth = betterAuth({
    plugins: [
        emailOTP({
            otpLength: 8,
            otpExpiry: 600
        })
    ]
})

There are two problems:

  • docs say that otpExpiry should be used, but typescript complains and requires expiresIn - otpExpiry does not exist in type EmailOTPOptions
  • both variables don't change expiry time - default value is always used, no matter what number is set

Current vs. Expected behavior

Explained above

What version of Better Auth are you using?

1.1.3

Provide environment information

Safari
MacOS

Which area(s) are affected? (Select all that apply)

Backend, Types, Documentation, Package

Auth config (if applicable)

No response

Additional context

No response

Originally created by @JosipPardon on GitHub (Dec 27, 2024). Original GitHub issue: https://github.com/better-auth/better-auth/issues/1030 ### Is this suited for github? - [X] Yes, this is suited for github ### To Reproduce ``` export const auth = betterAuth({ plugins: [ emailOTP({ otpLength: 8, otpExpiry: 600 }) ] }) ``` There are two problems: - [docs](https://www.better-auth.com/docs/plugins/email-otp#example) say that `otpExpiry` should be used, but typescript complains and requires `expiresIn` - `otpExpiry` does not exist in type `EmailOTPOptions` - both variables don't change expiry time - default value is always used, no matter what number is set ### Current vs. Expected behavior Explained above ### What version of Better Auth are you using? 1.1.3 ### Provide environment information ```bash Safari MacOS ``` ### Which area(s) are affected? (Select all that apply) Backend, Types, Documentation, Package ### Auth config (if applicable) _No response_ ### Additional context _No response_
GiteaMirror added the lockedbug labels 2026-04-13 03:40:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#8558