only link to confirmation email for registration

fixes CORE-2083

test plan
 - have custom auth
 - create a new user
 - the link the registration email should work
 - create a new communication_channel
 - the confirmation link should work

Change-Id: I16401289e96ec13835ed2a49b9c5f71fe93b40fd
Reviewed-on: https://gerrit.instructure.com/174125
QA-Review: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
Reviewed-by: James Williams <jamesw@instructure.com>
Product-Review: Rob Orton <rob@instructure.com>
This commit is contained in:
Rob Orton 2018-12-03 21:18:51 -07:00
parent be61dc2af3
commit 54b7f5c9be
10 changed files with 15 additions and 21 deletions

View File

@ -1,7 +1,7 @@
<% p = asset.is_a?(Pseudonym) ? asset : asset.pseudonym %>
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
<% define_content :link do %>
<%= p.user.registered? ? confirm_change_password_url(p, cc.confirmation_code) : registration_confirmation_url(cc.confirmation_code) %>
<%= p.user.registered? ? profile_url : registration_confirmation_url(cc.confirmation_code) %>
<% end %>
<% define_content :subject do %>

View File

@ -2,7 +2,7 @@
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
<% define_content :link do %>
<%= p.user.registered? ? confirm_change_password_url(p, cc.confirmation_code) : registration_confirmation_url(cc.confirmation_code) %>
<%= p.user.registered? ? profile_url : registration_confirmation_url(cc.confirmation_code) %>
<% end %>
<% define_content :subject do %>

View File

@ -1,7 +1,7 @@
<% p = asset.is_a?(Pseudonym) ? asset : asset.pseudonym %>
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
<% define_content :link do %>
<%= p.user.registered? ? confirm_change_password_url(p, cc.confirmation_code) : registration_confirmation_url(cc.confirmation_code) %>
<%= p.user.registered? ? profile_url : registration_confirmation_url(cc.confirmation_code) %>
<% end %>
<%= t :body, "You have been registered for a Canvas account at %{account}! Before you can log in and start using Canvas, you'll need to finish the configuration process.", :account => p.account.display_name %>

View File

@ -1,7 +1,7 @@
<% p = asset.is_a?(Pseudonym) ? asset : asset.pseudonym %>
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
<% define_content :link do %>
<%= p.user.registered? ? confirm_change_password_url(p, cc.confirmation_code) : registration_confirmation_url(cc.confirmation_code) %>
<%= p.user.registered? ? profile_url : registration_confirmation_url(cc.confirmation_code) %>
<% end %>
<% define_content :subject do %>
@ -11,4 +11,4 @@
<%= t :body, "You have been registered for a Canvas account at %{account}! Before you can log in and start using Canvas, you'll need to finish the configuration process.", :account => p.account.display_name %>
<%= t :link_message, "To finish the registration process, please visit the following url:" %>
<%= content :link %>
<%= content :link %>

View File

@ -2,7 +2,7 @@
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
<% define_content :link do -%>
<%= p.user.registered? ? confirm_change_password_url(p, cc.confirmation_code) : registration_confirmation_url(cc.confirmation_code) %>
<%= p.user.registered? ? profile_url : registration_confirmation_url(cc.confirmation_code) %>
<% end -%>
<%= t :body, "Canvas Alert - You have been registered for a Canvas account at %{account}!", :account => p.account.display_name %>
<%= t :body, "Canvas Alert - You have been registered for a Canvas account at %{account}!", :account => p.account.display_name %>

View File

@ -1,7 +1,6 @@
<% p = asset.is_a?(Pseudonym) ? asset : asset.pseudonym %>
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
<% define_content :link do %>
<%= p.user.registered? ? confirm_change_password_url(p, cc.confirmation_code) : registration_confirmation_url(cc.confirmation_code) %>
<%= profile_url %>
<% end %>
<% define_content :subject do %>

View File

@ -1,7 +1,6 @@
<% p = asset.is_a?(Pseudonym) ? asset : asset.pseudonym %>
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
<% define_content :link do %>
<%= p.user.registered? ? confirm_change_password_url(p, cc.confirmation_code) : registration_confirmation_url(cc.confirmation_code) %>
<%= profile_url %>
<% end %>
<% define_content :subject do %>

View File

@ -1,7 +1,6 @@
<% p = asset.is_a?(Pseudonym) ? asset : asset.pseudonym %>
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
<% define_content :link do %>
<%= p.user.registered? ? confirm_change_password_url(p, cc.confirmation_code) : registration_confirmation_url(cc.confirmation_code) %>
<%= profile_url %>
<% end %>
<%= t :body, "You have been registered for a Canvas account at %{account}! ", :account => p.account.display_name %>

View File

@ -1,7 +1,6 @@
<% p = asset.is_a?(Pseudonym) ? asset : asset.pseudonym %>
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
<% define_content :link do %>
<%= p.user.registered? ? confirm_change_password_url(p, cc.confirmation_code) : registration_confirmation_url(cc.confirmation_code) %>
<%= profile_url %>
<% end %>
<% define_content :subject do %>

View File

@ -1,8 +1,6 @@
<% p = asset.is_a?(Pseudonym) ? asset : asset.pseudonym %>
<% cc = asset.is_a?(CommunicationChannel) ? asset : (p.communication_channel || p.user.communication_channel) %>
<% define_content :link do %>
<%= profile_url %>
<% end %>
<% define_content :link do -%>
<%= p.user.registered? ? confirm_change_password_url(p, cc.confirmation_code) : registration_confirmation_url(cc.confirmation_code) %>
<% end -%>
<%= t :body, "Canvas Alert - You have been registered for a Canvas account at %{account}! ", :account => p.account.display_name %>
<%= t :body, "Canvas Alert - You have been registered for a Canvas account at %{account}! ", :account => p.account.display_name %>