Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Devise: Remove confirmation

I am using ng-token-auth with devise-token-auth.

This is my user.rb

class User < ActiveRecord::Base
  devise :database_authenticatable, :recoverable,
         :validatable, :omniauthable

  include DeviseTokenAuth::Concerns::User
end

I don't have confirmable listed but everytime I try to register, it tries to send a confirmation email and when I try to login, it says I have to follow the instructions in the email. How can I remove this? I went through the documentation and some posts, I thought that only happens when I have :confirmable in the user.rb. Any help would be appreciated. Thanks!

like image 263
Kelvin Avatar asked Dec 08 '25 10:12

Kelvin


1 Answers

That's strange that your code doesn't work as it pretty close to devise_token_auth documentation example. However maybe this Devise hint helps you:

Add to User model this method

protected
def confirmation_required?
  false
end

Taken from Devise wiki: https://github.com/plataformatec/devise/wiki/How-To:-Add-:confirmable-to-Users#allowing-unconfirmed-access

Hope, it will help you!

like image 100
Tetiana Chupryna Avatar answered Dec 10 '25 02:12

Tetiana Chupryna



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!