mirror of https://github.com/grafana/grafana
Auth: Fix email verification bypass when using basic authentication (#82914)
parent
fabaff9a24
commit
46c26bbd0b
@ -0,0 +1,40 @@ |
|||||||
|
<mjml> |
||||||
|
<!-- global variables --> |
||||||
|
<mj-include path="./partials/_globals.mjml" /> |
||||||
|
<!-- css styling --> |
||||||
|
<mj-include path="./partials/layout/theme.css" type="css" css-inline="inline" /> |
||||||
|
<mj-head> |
||||||
|
<!-- ⬇ Don't forget to specify an email subject below! ⬇ --> |
||||||
|
<mj-title> |
||||||
|
{{ Subject .Subject .TemplateData "Verify your new email - {{.Name}}" }} |
||||||
|
</mj-title> |
||||||
|
<mj-include path="./partials/layout/head.mjml" /> |
||||||
|
</mj-head> |
||||||
|
<mj-body> |
||||||
|
<mj-section> |
||||||
|
<mj-include path="./partials/layout/header.mjml" /> |
||||||
|
</mj-section> |
||||||
|
<mj-section css-class="background"> |
||||||
|
<mj-column> |
||||||
|
<mj-text> |
||||||
|
<h2>Hi {{ .Name }},</h2> |
||||||
|
</mj-text> |
||||||
|
<mj-text> |
||||||
|
Please click the following link to verify your email within <strong>{{ .VerificationEmailLifetimeHours }} hour(s)</strong>. |
||||||
|
</mj-text> |
||||||
|
<mj-button href="{{ .AppUrl }}user/email/update?code={{ .Code }}"> |
||||||
|
Verify Email |
||||||
|
</mj-button> |
||||||
|
<mj-text> |
||||||
|
You can also copy and paste this link into your browser directly: |
||||||
|
</mj-text> |
||||||
|
<mj-text> |
||||||
|
<a rel="noopener" href="{{ .AppUrl }}user/email/update?code={{ .Code }}">{{ .AppUrl }}user/email/update?code={{ .Code }}</a> |
||||||
|
</mj-text> |
||||||
|
</mj-column> |
||||||
|
</mj-section> |
||||||
|
<mj-section> |
||||||
|
<mj-include path="./partials/layout/footer.mjml" /> |
||||||
|
</mj-section> |
||||||
|
</mj-body> |
||||||
|
</mjml> |
@ -0,0 +1,6 @@ |
|||||||
|
[[HiddenSubject .Subject "Verify your new email - [[.Name]]"]] |
||||||
|
|
||||||
|
Hi [[.Name]], |
||||||
|
|
||||||
|
Copy and paste the following link directly in your browser to verify your email within [[.VerificationEmailLifetimeHours]] hour(s). |
||||||
|
[[.AppUrl]]user/email/update?code=[[.Code]] |
@ -0,0 +1,215 @@ |
|||||||
|
<!doctype html> |
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office"> |
||||||
|
|
||||||
|
<head> |
||||||
|
<title>{{ Subject .Subject .TemplateData "Verify your new email - {{.Name}}" }}</title> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if !mso]><!-->` }} |
||||||
|
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
||||||
|
{{ __dangerouslyInjectHTML `<!--<![endif]-->` }} |
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1"> |
||||||
|
<style type="text/css"> |
||||||
|
#outlook a { |
||||||
|
padding: 0; |
||||||
|
} |
||||||
|
|
||||||
|
body { |
||||||
|
margin: 0; |
||||||
|
padding: 0; |
||||||
|
-webkit-text-size-adjust: 100%; |
||||||
|
-ms-text-size-adjust: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
table, |
||||||
|
td { |
||||||
|
border-collapse: collapse; |
||||||
|
mso-table-lspace: 0pt; |
||||||
|
mso-table-rspace: 0pt; |
||||||
|
} |
||||||
|
|
||||||
|
img { |
||||||
|
border: 0; |
||||||
|
height: auto; |
||||||
|
line-height: 100%; |
||||||
|
outline: none; |
||||||
|
text-decoration: none; |
||||||
|
-ms-interpolation-mode: bicubic; |
||||||
|
} |
||||||
|
|
||||||
|
p { |
||||||
|
display: block; |
||||||
|
margin: 13px 0; |
||||||
|
} |
||||||
|
|
||||||
|
</style> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if mso]> |
||||||
|
<noscript> |
||||||
|
<xml> |
||||||
|
<o:OfficeDocumentSettings> |
||||||
|
<o:AllowPNG/> |
||||||
|
<o:PixelsPerInch>96</o:PixelsPerInch> |
||||||
|
</o:OfficeDocumentSettings> |
||||||
|
</xml> |
||||||
|
</noscript> |
||||||
|
<![endif]-->` }} |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if lte mso 11]> |
||||||
|
<style type="text/css"> |
||||||
|
.mj-outlook-group-fix { width:100% !important; } |
||||||
|
</style> |
||||||
|
<![endif]-->` }} |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if !mso]><!-->` }} |
||||||
|
<link href="https://fonts.googleapis.com/css?family=Inter" rel="stylesheet" type="text/css"> |
||||||
|
<style type="text/css"> |
||||||
|
@import url(https://fonts.googleapis.com/css?family=Inter); |
||||||
|
|
||||||
|
</style> |
||||||
|
{{ __dangerouslyInjectHTML `<!--<![endif]-->` }} |
||||||
|
<style type="text/css"> |
||||||
|
@media only screen and (min-width:480px) { |
||||||
|
.mj-column-per-100 { |
||||||
|
width: 100% !important; |
||||||
|
max-width: 100%; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
</style> |
||||||
|
<style media="screen and (min-width:480px)"> |
||||||
|
.moz-text-html .mj-column-per-100 { |
||||||
|
width: 100% !important; |
||||||
|
max-width: 100%; |
||||||
|
} |
||||||
|
|
||||||
|
</style> |
||||||
|
<style type="text/css"> |
||||||
|
@media only screen and (max-width:479px) { |
||||||
|
table.mj-full-width-mobile { |
||||||
|
width: 100% !important; |
||||||
|
} |
||||||
|
|
||||||
|
td.mj-full-width-mobile { |
||||||
|
width: auto !important; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
</style> |
||||||
|
<style type="text/css"> |
||||||
|
</style> |
||||||
|
</head> |
||||||
|
|
||||||
|
<body style="word-spacing:normal;"> |
||||||
|
<div class="canvas" style="background-color: #fff;"> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if mso | IE]><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->` }} |
||||||
|
<div style="margin:0px auto;max-width:600px;"> |
||||||
|
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"> |
||||||
|
<tbody> |
||||||
|
<tr> |
||||||
|
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;"> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->` }} |
||||||
|
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"> |
||||||
|
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="background-color:transparent;vertical-align:top;" width="100%"> |
||||||
|
<tbody> |
||||||
|
<tr> |
||||||
|
<td align="left" style="font-size:0px;padding:0;word-break:break-word;"> |
||||||
|
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:collapse;border-spacing:0px;"> |
||||||
|
<tbody> |
||||||
|
<tr> |
||||||
|
<td style="width:200px;"> |
||||||
|
<img src="https://grafana.com/static/assets/img/logo_new_transparent_light_400x100.png" style="border:0;display:block;outline:none;text-decoration:none;height:auto;width:100%;font-size:13px;" width="200" height="auto"> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if mso | IE]></td></tr></table><![endif]-->` }} |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="background-outlook" role="presentation" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->` }} |
||||||
|
<div class="background" style="background-color: #FFF; border: 1px solid #e4e5e6; margin: 0px auto; max-width: 600px;"> |
||||||
|
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"> |
||||||
|
<tbody> |
||||||
|
<tr> |
||||||
|
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;"> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->` }} |
||||||
|
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"> |
||||||
|
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%"> |
||||||
|
<tbody> |
||||||
|
<tr> |
||||||
|
<td align="left" class="txt" style="font-size:0px;padding:10px 25px;word-break:break-word;"> |
||||||
|
<div style="font-family: Inter, Helvetica, Arial; font-size: 13px; line-height: 150%; text-align: left; color: #000000;"> |
||||||
|
<h2>Hi {{ .Name }},</h2> |
||||||
|
</div> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td align="left" class="txt" style="font-size:0px;padding:10px 25px;word-break:break-word;"> |
||||||
|
<div style="font-family: Inter, Helvetica, Arial; font-size: 13px; line-height: 150%; text-align: left; color: #000000;">Please click the following link to verify your email within <strong>{{ .VerificationEmailLifetimeHours }} hour(s)</strong>.</div> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td align="center" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;"> |
||||||
|
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:separate;line-height:100%;"> |
||||||
|
<tbody> |
||||||
|
<tr> |
||||||
|
<td align="center" bgcolor="#3D71D9" role="presentation" style="border:none;border-radius:3px;cursor:auto;mso-padding-alt:10px 25px;background:#3D71D9;" valign="middle"> |
||||||
|
<a href="{{ .AppUrl }}user/email/update?code={{ .Code }}" rel="noopener" style="display: inline-block; background: #3D71D9; color: #ffffff; font-family: Inter, Helvetica, Arial; font-size: 13px; font-weight: normal; line-height: 120%; margin: 0; text-decoration: none; text-transform: none; padding: 10px 25px; mso-padding-alt: 0px; border-radius: 3px;" target="_blank"> Verify Email </a> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td align="left" class="txt" style="font-size:0px;padding:10px 25px;word-break:break-word;"> |
||||||
|
<div style="font-family: Inter, Helvetica, Arial; font-size: 13px; line-height: 150%; text-align: left; color: #000000;">You can also copy and paste this link into your browser directly:</div> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td align="left" class="txt" style="font-size:0px;padding:10px 25px;word-break:break-word;"> |
||||||
|
<div style="font-family: Inter, Helvetica, Arial; font-size: 13px; line-height: 150%; text-align: left; color: #000000;"><a rel="noopener" href="{{ .AppUrl }}user/email/update?code={{ .Code }}" style="color: #6E9FFF;">{{ .AppUrl }}user/email/update?code={{ .Code }}</a></div> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if mso | IE]></td></tr></table><![endif]-->` }} |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if mso | IE]></td></tr></table><table align="center" border="0" cellpadding="0" cellspacing="0" class="" role="presentation" style="width:600px;" width="600" ><tr><td style="line-height:0px;font-size:0px;mso-line-height-rule:exactly;"><![endif]-->` }} |
||||||
|
<div style="margin:0px auto;max-width:600px;"> |
||||||
|
<table align="center" border="0" cellpadding="0" cellspacing="0" role="presentation" style="width:100%;"> |
||||||
|
<tbody> |
||||||
|
<tr> |
||||||
|
<td style="direction:ltr;font-size:0px;padding:20px 0;text-align:center;"> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if mso | IE]><table role="presentation" border="0" cellpadding="0" cellspacing="0"><tr><td class="" style="vertical-align:top;width:600px;" ><![endif]-->` }} |
||||||
|
<div class="mj-column-per-100 mj-outlook-group-fix" style="font-size:0px;text-align:left;direction:ltr;display:inline-block;vertical-align:top;width:100%;"> |
||||||
|
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="background-color:transparent;vertical-align:top;" width="100%"> |
||||||
|
<tbody> |
||||||
|
<tr> |
||||||
|
<td align="center" class="txt" style="font-size:0px;padding:10px 25px;word-break:break-word;"> |
||||||
|
<div style="font-family: Inter, Helvetica, Arial; font-size: 13px; line-height: 150%; text-align: center; color: #000000;">© {{ now | date "2006" }} Grafana Labs. Sent by <a href="{{ .AppUrl }}" style="color: #6E9FFF;">Grafana v{{ .BuildVersion }}</a>.</div> |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if mso | IE]></td></tr></table><![endif]-->` }} |
||||||
|
</td> |
||||||
|
</tr> |
||||||
|
</tbody> |
||||||
|
</table> |
||||||
|
</div> |
||||||
|
{{ __dangerouslyInjectHTML `<!--[if mso | IE]></td></tr></table><![endif]-->` }} |
||||||
|
</div> |
||||||
|
</body> |
||||||
|
|
||||||
|
</html> |
@ -0,0 +1,9 @@ |
|||||||
|
{{HiddenSubject .Subject "Verify your new email - {{.Name}}"}} |
||||||
|
|
||||||
|
Hi {{.Name}}, |
||||||
|
|
||||||
|
Copy and paste the following link directly in your browser to verify your email within {{.VerificationEmailLifetimeHours}} hour(s). |
||||||
|
{{.AppUrl}}user/email/update?code={{.Code}} |
||||||
|
|
||||||
|
|
||||||
|
Sent by Grafana v{{.BuildVersion}} (c) {{now | date "2006"}} Grafana Labs |
Loading…
Reference in new issue