Devise - Confirming after the user edits email

后端 未结 3 2094
别跟我提以往
别跟我提以往 2021-02-07 14:17

I\'ve been trying to figure this out for 2 days. I\'m confirming user accounts with email confirmations (via Devise). I finally got all that working, but the whole point was to

相关标签:
3条回答
  • 2021-02-07 14:58

    You could wait it out until the reconfirmable module is released (they're working on it).

    For now it's in a pull request:

    https://github.com/plataformatec/devise/pull/1120

    0 讨论(0)
  • 2021-02-07 15:03

    We had a similar issue (mainly because a confirmed user is not really an approved user in our system)- and decided to go with a user_status attribute. It has 2 statuses - "pending" which is confirmed but not yet approved, and "approved". If for some reason the user was no longer approved (in your case, they changed their email address), then we change them back to pending.

    We have a before_filter on the applicationController to verify where they should be going based on their status.

    def check_user_status
    if current_user #logged in
     case current_user.status
       when "pending" 
         redirect_to root_path #user hasn't been approved yet
       when "approved"
         #tracking logic here   
      end
     end
    end
    

    Hope this helps.

    0 讨论(0)
  • 2021-02-07 15:10

    bundle update devise. This has been fixed in current released version (2.0)

    0 讨论(0)
提交回复
热议问题