diff options
author | Douwe Maan <douwe@gitlab.com> | 2017-12-05 09:01:46 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-12-05 09:01:46 +0000 |
commit | 0131c97c611e3327d819f61a09724e21708e0259 (patch) | |
tree | add3ed93627545152193d033d369335e56903f54 | |
parent | 61392168a0265e6c54cbccc6b7529822b123ff5b (diff) | |
parent | b0e2e21b7db5cc80f6a17b19354e91dd7fcf6c8c (diff) | |
download | gitlab-ce-0131c97c611e3327d819f61a09724e21708e0259.tar.gz |
Merge branch '39367-fix-new-email-session-path' into 'master'
remove ambiguity about which resource type to be using for new sessions
Closes #39367
See merge request gitlab-org/gitlab-ce!15726
-rw-r--r-- | app/views/devise/passwords/edit.html.haml | 4 | ||||
-rw-r--r-- | app/views/devise/sessions/_new_base.html.haml | 2 | ||||
-rw-r--r-- | app/views/devise/shared/_links.erb | 10 | ||||
-rw-r--r-- | app/views/devise/shared/_sign_in_link.html.haml | 2 | ||||
-rw-r--r-- | app/views/devise/shared/_signup_box.html.haml | 2 | ||||
-rw-r--r-- | app/views/errors/omniauth_error.html.haml | 2 | ||||
-rw-r--r-- | changelogs/unreleased/39367-fix-new-email-session-path.yml | 5 |
7 files changed, 16 insertions, 11 deletions
diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index eb0e6701627..35dafb3e980 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,7 +1,7 @@ = render 'devise/shared/tab_single', tab_title:'Change your password' .login-box .login-body - = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: 'gl-show-field-errors' }) do |f| + = form_for(resource, as: resource_name, url: password_path(:user), html: { method: :put, class: 'gl-show-field-errors' }) do |f| .devise-errors = devise_error_messages! = f.hidden_field :reset_password_token @@ -17,5 +17,5 @@ .clearfix.prepend-top-20 %p %span.light Didn't receive a confirmation email? - = link_to "Request a new one", new_confirmation_path(resource_name) + = link_to "Request a new one", new_confirmation_path(:user) = render 'devise/shared/sign_in_link' diff --git a/app/views/devise/sessions/_new_base.html.haml b/app/views/devise/sessions/_new_base.html.haml index 4095f30c369..41462f503cb 100644 --- a/app/views/devise/sessions/_new_base.html.haml +++ b/app/views/devise/sessions/_new_base.html.haml @@ -11,6 +11,6 @@ = f.check_box :remember_me, class: 'remember-me-checkbox' %span Remember me .pull-right.forgot-password - = link_to "Forgot your password?", new_password_path(resource_name) + = link_to "Forgot your password?", new_password_path(:user) .submit-container.move-submit-down = f.submit "Sign in", class: "btn btn-save" diff --git a/app/views/devise/shared/_links.erb b/app/views/devise/shared/_links.erb index 6e1cc244f26..cb934434c28 100644 --- a/app/views/devise/shared/_links.erb +++ b/app/views/devise/shared/_links.erb @@ -1,19 +1,19 @@ <%- if controller_name != 'sessions' %> - <%= link_to "Sign in", new_session_path(resource_name), class: "btn" %><br /> + <%= link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes'), class: "btn" %><br /> <% end -%> <%- if devise_mapping.registerable? && controller_name != 'registrations' && allow_signup? %> - <%= link_to "Sign up", new_registration_path(resource_name) %><br /> + <%= link_to "Sign up", new_registration_path(:user) %><br /> <% end -%> <%- if devise_mapping.recoverable? && controller_name != 'passwords' %> -<%= link_to "Forgot your password?", new_password_path(resource_name), class: "btn" %><br /> +<%= link_to "Forgot your password?", new_password_path(:user), class: "btn" %><br /> <% end -%> <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %> - <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br /> + <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(:user) %><br /> <% end -%> <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %> - <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br /> + <%= link_to "Didn't receive unlock instructions?", new_unlock_path(:user) %><br /> <% end -%> diff --git a/app/views/devise/shared/_sign_in_link.html.haml b/app/views/devise/shared/_sign_in_link.html.haml index 289bf40f3de..77ef103cc47 100644 --- a/app/views/devise/shared/_sign_in_link.html.haml +++ b/app/views/devise/shared/_sign_in_link.html.haml @@ -1,4 +1,4 @@ %p %span.light Already have login and password? - = link_to "Sign in", new_session_path(resource_name) + = link_to "Sign in", new_session_path(:user, redirect_to_referer: 'yes') diff --git a/app/views/devise/shared/_signup_box.html.haml b/app/views/devise/shared/_signup_box.html.haml index 298604dee8c..2554b2688bb 100644 --- a/app/views/devise/shared/_signup_box.html.haml +++ b/app/views/devise/shared/_signup_box.html.haml @@ -31,4 +31,4 @@ %p %span.light Didn't receive a confirmation email? = succeed '.' do - = link_to "Request a new one", new_confirmation_path(resource_name) + = link_to "Request a new one", new_confirmation_path(:user) diff --git a/app/views/errors/omniauth_error.html.haml b/app/views/errors/omniauth_error.html.haml index 20b7fa471a0..a2a4c75daad 100644 --- a/app/views/errors/omniauth_error.html.haml +++ b/app/views/errors/omniauth_error.html.haml @@ -9,7 +9,7 @@ %p Try logging in using your username or email. If you have forgotten your password, try recovering it = link_to "Sign in", new_session_path(:user), class: 'btn primary' - = link_to "Recover password", new_password_path(resource_name), class: 'btn secondary' + = link_to "Recover password", new_password_path(:user), class: 'btn secondary' %hr %p.light If none of the options work, try contacting a GitLab administrator. diff --git a/changelogs/unreleased/39367-fix-new-email-session-path.yml b/changelogs/unreleased/39367-fix-new-email-session-path.yml new file mode 100644 index 00000000000..73485d9d1a9 --- /dev/null +++ b/changelogs/unreleased/39367-fix-new-email-session-path.yml @@ -0,0 +1,5 @@ +--- +title: Confirming email with invalid token should no longer generate an error +merge_request: 15726 +author: +type: fixed |