Commit 46231f0f1d2d8aad0712ba98a6368af138a8561c

Authored by Dmitriy Zaporozhets
1 parent fbf69899

Fix password set form and infinite loop

app/controllers/passwords_controller.rb
1 class PasswordsController < ApplicationController 1 class PasswordsController < ApplicationController
2 layout 'navless' 2 layout 'navless'
3 3
  4 + skip_before_filter :check_password_expiration
  5 +
4 before_filter :set_user 6 before_filter :set_user
5 before_filter :set_title 7 before_filter :set_title
6 8
app/views/passwords/new.html.haml
1 -%h3.page_title Setup your new password  
2 -  
3 -%br  
4 -  
5 -= form_for @user, url: profile_password_path, method: :put do |f|  
6 - .padded  
7 - %p.slead After successful password update you will be redirected to dashboard 1 += form_for @user, url: profile_password_path, method: :post do |f|
  2 + .light-well.padded
  3 + %p.slead
  4 + Please set new password before proceed.
  5 + %br
  6 + After successful password update you will be redirected to login screen
8 -if @user.errors.any? 7 -if @user.errors.any?
9 .alert.alert-error 8 .alert.alert-error
10 %ul 9 %ul
@@ -20,4 +19,4 @@ @@ -20,4 +19,4 @@
20 = f.password_field :password_confirmation, required: true 19 = f.password_field :password_confirmation, required: true
21 .clearfix 20 .clearfix
22 .input 21 .input
23 - = f.submit 'Save password', class: "btn btn-save" 22 + = f.submit 'Set new password', class: "btn btn-create"