2FA / TOTP "trust device" bugs
Quick summary:
I tried this on Brave and then again using Safari and the behavior was the same on both. Also, @Kon just posted this same issue in general today: https://discord.com/channels/1288403910284935179/1288403910284935182/1373638125301010442
Thanks for any help!
- When TOTP is entered, user chooses to trust device.
trust_devicecookie is set. Expiration date looks like it's 30 days out (docs say it should be 60)- log out
- Log back in; TOTP is not requested (good!)
- I check the
trust_devicecookie; the expiration time is now set to "session". (???) - Log out/in -> TOTP is requested (bad!)
- When the user logs in and they've trusted the device, it only works once since the cookie's expiration is changed to "session" when they log in with the skip.
- The docs say that trust device is for 60 days, but actual cookie looks to be set to 30 days. Link to docs that say: "When trustDevice is set to true, the current device will be remembered for 60 days.": https://www.better-auth.com/docs/plugins/2fa#trusted-devices
I tried this on Brave and then again using Safari and the behavior was the same on both. Also, @Kon just posted this same issue in general today: https://discord.com/channels/1288403910284935179/1288403910284935182/1373638125301010442
Thanks for any help!