mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-02-05 00:29:40 +03:00
_enable_email_2fa default not set as expected
#449
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @vplme on GitHub (Oct 16, 2019).
The config option for
_enable_email_2fa:means that when SMTP is enabled (default true) and the SMTP_HOST is filled, 2FA email should also be enabled. This is not the case for me.
If I move the Email 2FA config block to after the SMTP config block it does work as expected.
i.e. this works:
Branch: https://github.com/dani-garcia/bitwarden_rs/compare/master...vverst:enable-2fa-email
I'm not familiar with macros but I'm assuming it evaluates the closure before the SMTP config block has been configured and stores that result.
Should we just move the configuration or is there a nicer solution? Maybe evaluating the closures once the initial configuration has been set?
@dani-garcia commented on GitHub (Oct 16, 2019):
Yeah the options are parsed in order so if the closure is placed before the settings it references it won't work.
I think for now swapping the position of the config blocks is fine. We could do as you say and run two passes through the configuration but it would complicate the code without much benefit (as long as all the auto settings are placed after the fields they reference it won't have any effect).
Can you make a PR to swap the blocks?
@vplme commented on GitHub (Oct 16, 2019):
Ok. I made a PR.