Giter VIP home page Giter VIP logo

Comments (8)

lynndylanhurley avatar lynndylanhurley commented on August 26, 2024

No problem! I'll implement this ASAP.

from devise_token_auth.

lynndylanhurley avatar lynndylanhurley commented on August 26, 2024

@andreasseiler - after thinking about this, I think the best option is to use a before_create callback on the model. So something like this:

class User < ActiveRecord::Base
  include DeviseTokenAuth::Concerns::User
  before_create :skip_confirmation!
end

And just to be clear, the skip_confirmation! method is available in the current version of this gem.

Does this solution work for you?

from devise_token_auth.

booleanbetrayal avatar booleanbetrayal commented on August 26, 2024

I'm actually running up against this too. I didn't want to include the confirmation* columns in my schema since I wasn't going to be using them. Only thing I've tried that works thus far is overriding all of the confirmations methods, since devise_token_auth is explicitly enabling that devise feature set. Here are problematic attributes and my overrides:

# Force disable confirmation in devise_token_auth

def confirm_success_url 
    '/'
end
def confirm_success_url=(val)
end

def confirmed?
    true
end

def confirmed_at 
    DateTime.now
end
def confirmed_at=(val)
end

def unconfirmed_email 
    self.email
end
def unconfirmed_email=(val)
end

def send_confirmation_instructions(opts=nil)
end

protected
def confirmation_required?
  false
end

EDIT: skip_confirmation! may work if these columns are included in the schema (haven't tested), but doesn't seem to help my situation, atm.

from devise_token_auth.

lynndylanhurley avatar lynndylanhurley commented on August 26, 2024

As of the latest version (v0.1.28), the confirm_success_url and password_reset_success_url columns are no longer used.

With the next release I plan to make the inclusion of each devise module optional.

from devise_token_auth.

booleanbetrayal avatar booleanbetrayal commented on August 26, 2024

Sounds great @lynndylanhurley . Thanks as always for all the hard work! =]

from devise_token_auth.

lynndylanhurley avatar lynndylanhurley commented on August 26, 2024

(^^,)

from devise_token_auth.

andreasseiler avatar andreasseiler commented on August 26, 2024

Sounds really great! Thanks so much!

from devise_token_auth.

lynndylanhurley avatar lynndylanhurley commented on August 26, 2024

I've added improvements to version 0.1.29.beta2 to simplify this scenario. The updated documentation is here.

from devise_token_auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.