-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AO3-6772 Create reset_password_instructions mailer preview (#4895)
* AO3-6772 Create reset_password_instructions mailer preview * AO3-6772 Remove useless html_safe call The url is in the form of "https://archiveofourown.org/users/password/edit?reset_password_token=Token" Nothing in this url could become mangled by getting html escaped, it's a standard url and the Token is generated with SecureRandom.urlsafe_base64 without padding, so can only contain A-Z, a-z, 0-9, - and _. So it does not need to be marked as html_safe. Additionally, the admin version of this mail also doesn't call html_safe on the url, neither does devise's own implementation of it.
- Loading branch information
Showing
7 changed files
with
53 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
<% content_for :message do %> | ||
<p><%= t("mailer.general.greeting.formal_html", name: style_bold(@resource.login)) %></p> | ||
<p><%= t(".intro") %></p> | ||
<p><%= style_link t(".link_title"), edit_user_password_url(reset_password_token: @token).html_safe %></p> | ||
<p><%= style_link t(".link_title"), edit_user_password_url(reset_password_token: @token) %></p> | ||
<p><%= t(".expiration") %></p> | ||
<p><%= t(".unrequested") %></p> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# frozen_string_literal: true | ||
|
||
class ArchiveDeviseMailerPreview < ApplicationMailerPreview | ||
# Sent when a user requests a password reset | ||
def reset_password_instructions | ||
user = create(:user, :for_mailer_preview) | ||
ArchiveDeviseMailer.reset_password_instructions(user, "fakeToken") | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters