Commit 46231f0f authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix password set form and infinite loop

parent fbf69899
class PasswordsController < ApplicationController class PasswordsController < ApplicationController
layout 'navless' layout 'navless'
skip_before_filter :check_password_expiration
before_filter :set_user before_filter :set_user
before_filter :set_title before_filter :set_title
......
%h3.page_title Setup your new password = form_for @user, url: profile_password_path, method: :post do |f|
.light-well.padded
%br %p.slead
Please set new password before proceed.
= form_for @user, url: profile_password_path, method: :put do |f| %br
.padded After successful password update you will be redirected to login screen
%p.slead After successful password update you will be redirected to dashboard
-if @user.errors.any? -if @user.errors.any?
.alert.alert-error .alert.alert-error
%ul %ul
...@@ -20,4 +19,4 @@ ...@@ -20,4 +19,4 @@
= f.password_field :password_confirmation, required: true = f.password_field :password_confirmation, required: true
.clearfix .clearfix
.input .input
= f.submit 'Save password', class: "btn btn-save" = f.submit 'Set new password', class: "btn btn-create"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment