mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-26 01:35:54 +03:00
[GH-ISSUE #668] _enable_email_2fa default not set as expected #449
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#449
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/668
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.