How to change email address of a user in devise “safely”?

前端 未结 2 1687
情话喂你
情话喂你 2021-02-01 10:02

By default, devise uses an email address for sign up and sign in.

But I want that the email address should be allowed to be changed by the user.

If I allow the u

2条回答
  •  遥遥无期
    2021-02-01 10:48

    Devise does this out of the box. Here is the info from the initializer:

    # If true, requires any email changes to be confirmed (exactly the same way as
    # initial account confirmation) to be applied. Requires additional unconfirmed_email
    # db field (see migrations). Until confirmed new email is stored in
    # unconfirmed email column, and copied to email column on successful confirmation.
    config.reconfirmable = true
    

    In confirmable module you may see how it works.

提交回复
热议问题