Answer the question
In order to leave comments, you need to log in
Why does the Device log out after changing the password?
Hello, I can not get the Device gem, I will be grateful for any help.
The administrator can change his email and password.
If he changes the password, then he throws it out on the authorization page.
If the email changes, then everything is fine.
How to disable this feature?
Devise 3.5.6
Controller:
def update_profile
if current_admin.update(admin_params)
redirect_to dashboard_settings_path
else
flash[:errors] = current_admin.errors.full_messages.to_sentence
render :index
end
end
....
private
def admin_params
params.require(:admin).permit(:email, :password)
end
# == Schema Information
#
# Table name: admins
#
# id :integer not null, primary key
# email :string default(""), not null
# encrypted_password :string default(""), not null
# reset_password_token :string
# reset_password_sent_at :datetime
# remember_created_at :datetime
# sign_in_count :integer default("0"), not null
# current_sign_in_at :datetime
# last_sign_in_at :datetime
# current_sign_in_ip :string
# last_sign_in_ip :string
# created_at :datetime not null
# updated_at :datetime not null
#
class Admin < ActiveRecord::Base
# :confirmable, :lockable, :timeoutable :omniauthable :registerable, :validatable :recoverable, :trackable
devise :database_authenticatable, :rememberable
end
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question