Type Error adding TwoFactor

Hey!

Im currently trying to add the twoFactor plugin to my app, in the following way:

[...]
    maxPasswordLength: 32,
    },
    plugins: [
      twoFactor(),
      username(),
[...]


but im getting the following error:

Type '{ id: "two-factor"; endpoints: { enableTwoFactor: { <C extends [{ body: { password: string; }; method?: "POST" | undefined; query?: Record<string, any> | undefined; params?: Record<string, any> | undefined; request?: Request | undefined; headers?: HeadersInit | undefined; asResponse?: boolean | undefined; returnHead...' is not assignable to type 'BetterAuthPlugin' with 'exactOptionalPropertyTypes: true'. Consider adding 'undefined' to the types of the target's properties.
  Types of property 'options' are incompatible.
    Type 'TwoFactorOptions | undefined' is not assignable to type 'Record<string, any>'.
      Type 'undefined' is not assignable to type 'Record<string, any>'.
Was this page helpful?