0
votes

How can you override the reset-password functionality of devise so that a person can create an account without a password but required to confirm their email address.

Then when they receive the confirmation email, they are asked to "reset/set" their password?

Seems like the optimal user-flow but its not obvious how to achieve.

I started to follow: https://github.com/plataformatec/devise/wiki/How-To:-Override-confirmations-so-users-can-pick-their-own-passwords-as-part-of-confirmation-activation

But it does not include view changes OR RegistrationsController changes.

1

1 Answers

1
votes

You can override view changes by using rails generate devise:views This will copy all the views from devise to your project and then you can change as needed.

Not sure you need to make any changes in Registrations controller but you will definitely need to make some changes to your User model as mentioned here - https://github.com/plataformatec/devise/wiki/How-To:-Override-confirmations-so-users-can-pick-their-own-passwords-as-part-of-confirmation-activation#4-update-configinitializersdeviserb

and also here - https://github.com/plataformatec/devise/wiki/How-To:-Override-confirmations-so-users-can-pick-their-own-passwords-as-part-of-confirmation-activation#2-add-these-methods-to-your-user-model

So, if you still need to make changes to RegistrationsController then you can create a new controller inheriting from Devise::RegistrationController Override devise registrations controller