Sha256: af5b2386b9ab7ec9b8b10d574b7fb74320977ba6610e910dfc7063b9f41f81c8
Contents?: true
Size: 981 Bytes
Versions: 16
Compression:
Stored size: 981 Bytes
Contents
require 'devise/doorkeeper/version' require 'devise/strategies/doorkeeper' require 'devise/doorkeeper/doorkeeper_failure_app' module Devise module Doorkeeper # configure devise to support doorkeeper error responses def self.configure_devise(config) Devise::FailureApp.prepend(Devise::Doorkeeper::DoorkeeperFailureApp) end # configure doorkeeper to use devise authentication def self.configure_doorkeeper(base) base.instance_eval do resource_owner_authenticator do current_user || warden.authenticate!(scope: :user) end # configure doorkeeper to use devise database authenticatable plugin resource_owner_from_credentials do user = User.find_for_database_authentication(email: params[:username]) if user && user.valid_for_authentication? { user.valid_password?(params[:password]) } user else nil end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems