Remove administrateur devise methods

This commit is contained in:
simon lehericey 2019-08-09 10:38:27 +02:00
parent 65d862b59d
commit 840be2408e
4 changed files with 2 additions and 8 deletions

View file

@ -23,7 +23,7 @@ class Users::ActivateController < ApplicationController
if user && user.errors.empty?
sign_in(user, scope: :user)
try_to_authenticate(Administrateur, user.email, password)
flash.notice = "Mot de passe enregistré"
redirect_to instructeur_procedures_path
else

View file

@ -16,8 +16,7 @@ class Users::SessionsController < Sessions::SessionsController
def create
remember_me = params[:user][:remember_me] == '1'
if resource_locked?(try_to_authenticate(User, remember_me)) ||
resource_locked?(try_to_authenticate(Administrateur, remember_me))
if resource_locked?(try_to_authenticate(User, remember_me))
flash.alert = 'Votre compte est verrouillé.'
new
return render :new, status: 401

View file

@ -3,9 +3,6 @@ class Administrateur < ApplicationRecord
include EmailSanitizableConcern
include ActiveRecord::SecureToken
devise :database_authenticatable, :registerable, :async,
:recoverable, :rememberable, :trackable, :validatable, :lockable
has_and_belongs_to_many :instructeurs
has_many :administrateurs_procedures
has_many :procedures, through: :administrateurs_procedures

View file

@ -77,8 +77,6 @@ Rails.application.routes.draw do
omniauth_callbacks: 'administrations/omniauth_callbacks'
}
devise_for :administrateurs, skip: :all
devise_for :users, controllers: {
sessions: 'users/sessions',
registrations: 'users/registrations',