How to remove devise password resetting during email confirmation?
Asked Answered
H

3

0

My email confirmation works with devise, however I want to remove this automatic password resetting. I don't manage to find in which file devise orders this action. Thank you in advance !

Honeyman answered 16/7, 2013 at 9:28 Comment(4)
What's the problem again?Euchromatin
Do you mean Forgot your password? functionality?Ingra
I think I did not write clearly, sorry. When I click on my link for email confirmation, it resets automatically password of the account whereas I do not want to.Honeyman
It's ok now ! I thought it was because of devise but the problem was the encryption used in Michael Hartl's tutorial ! I found the solution here : #5463653Honeyman
I
2

Just disable :recoverable module in User model and remove Forgot your password? link in devise/sessions/new.html.erb

Ingra answered 16/7, 2013 at 9:33 Comment(1)
It seems you just have to remove :recoverable and the link will not be renderedScheelite
S
1

If you don't want password recovery functionality in Devise, you should not set devise attribute ':recoverable' in your model. Please remove this attribute from your model, remove forgot password links from you views and you will no longer be able to reset password with Devise.

Skydive answered 16/7, 2013 at 9:54 Comment(0)
O
0

Presuming your devise model is User:

  1. Remove :recoverable module in app/models/user.rb
  2. If you once had your devise views generated, remove Forgot your password? link in app/views/devise/shared/_links.html.erb
  3. Create a migration dropping reset_password_token and reset_password_sent_at of your users table:

First run:

rails g migration RemoveRecoverableFromUsers

Edit migration:

class RemoveRecoverableFromUsers < ActiveRecord::Migration[5.0]
  def up
    remove_column :users, :reset_password_token
    remove_column :users, :reset_password_sent_at
  end

  def down
    add_column :users, :reset_password_token, :string
    add_column :users, :reset_password_sent_at, :datetime
  end
end
Obverse answered 2/4, 2017 at 17:45 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.