Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
f5f1056
Merge pull request #650 from DefGuard/dev
t-aleksander Jun 25, 2024
7e6ad6f
Merge pull request #656 from DefGuard/dev
t-aleksander Jul 1, 2024
39015c7
Merge pull request #659 from DefGuard/dev
t-aleksander Jul 3, 2024
add6d2e
Merge pull request #664 from DefGuard/dev
t-aleksander Jul 8, 2024
8e176c1
Update README.md
teon Jul 24, 2024
63f6129
Update README.md
teon Jul 24, 2024
749ded4
Update README.md
teon Jul 24, 2024
153e436
Update README.md
teon Jul 24, 2024
92c0bb3
Update README.md
teon Jul 24, 2024
e34d568
Update README.md
teon Jul 27, 2024
77f8a03
Update README.md
teon Jul 27, 2024
bcac232
Update README.md
teon Jul 31, 2024
e425ce8
video intro
teon Aug 12, 2024
bc1cfe8
Update README.md
teon Aug 12, 2024
0098b63
Update README.md
teon Aug 14, 2024
43b4ab0
Update README.md
teon Aug 20, 2024
5131ced
center Date section & Copyright
cpprian Aug 23, 2024
a3de9c1
add name into email context
cpprian Aug 23, 2024
32fa2a9
Merge branch 'dev' into mfa-code-email-reformat
cpprian Aug 23, 2024
2cebde8
change link to client download page
cpprian Aug 23, 2024
033c01b
Merge branch 'mfa-code-email-reformat' of github.com:DefGuard/defguarโ€ฆ
cpprian Aug 23, 2024
64214bc
cargo fmt
cpprian Aug 23, 2024
86fc503
fix bugs
cpprian Aug 23, 2024
7adbdd0
add span
cpprian Aug 23, 2024
600a479
del <b> tag from EMAIL_CODE_REGEX in test auth.rs
cpprian Aug 23, 2024
8759aad
try b tag
cpprian Aug 23, 2024
b4c0fbb
Merge remote-tracking branch 'origin/dev' into mfa-code-email-reformat
cpprian Aug 27, 2024
e692b1a
fix footer
cpprian Aug 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/templates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,8 @@ pub fn email_mfa_activation_mail(
) -> Result<String, TemplateError> {
let (mut tera, mut context) = get_base_tera(None, Some(session), None, None)?;
let timeout = server_config().mfa_code_timeout;
context.insert("code", code);
// zero-pad code to make sure it's always 6 digits long
context.insert("code", &format!("{code:0>6}"));
context.insert("timeout", &timeout.to_string());
context.insert("name", &user.first_name);
tera.add_raw_template("mail_email_mfa_activation", MAIL_EMAIL_MFA_ACTIVATION)?;
Expand All @@ -276,7 +277,8 @@ pub fn email_mfa_code_mail(
) -> Result<String, TemplateError> {
let (mut tera, mut context) = get_base_tera(None, session, None, None)?;
let timeout = server_config().mfa_code_timeout;
context.insert("code", code);
// zero-pad code to make sure it's always 6 digits long
context.insert("code", &format!("{code:0>6}"));
context.insert("timeout", &timeout.to_string());
context.insert("name", &user.first_name);
tera.add_raw_template("mail_email_mfa_code", MAIL_EMAIL_MFA_CODE)?;
Expand Down
2 changes: 1 addition & 1 deletion templates/base.tera
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@
</p>
{% endif %}
{% if ip_address %}
< style="margin: auto;">
<p style="margin: auto;">
<span>IP Address:</span> {{ ip_address | safe }}
</p>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion templates/mail_mfa_configured.tera
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ mfa_method -> what method was activated
{% import "macros.tera" as macros %}
{% block mail_content %}
{% set section_content = [macros::paragraph(content="A Multi-Factor Authorization method: " ~ mfa_method ~ " has been
activated in your account.")] %}
activated in your account.", align="center")] %}
{{ macros::text_section(content_array=section_content) }}
{% endblock %}