mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 03:30:33 +02:00
Add new login design
This commit is contained in:
parent
1f2c12d7da
commit
a0592833a9
17 changed files with 64 additions and 13 deletions
|
@ -1,6 +1,4 @@
|
|||
class Admin::DomainsController < ApplicationController
|
||||
load_and_authorize_resource
|
||||
|
||||
before_action :set_domain, only: [:show, :edit, :update, :destroy]
|
||||
before_action :verify_deletion, only: [:destroy]
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ class ApplicationController < ActionController::Base
|
|||
protect_from_forgery with: :exception
|
||||
|
||||
def after_sign_in_path_for(resource)
|
||||
if current_user.admin?
|
||||
if resource.admin?
|
||||
(session[:user_return_to].nil?) ? admin_root_path : session[:user_return_to].to_s
|
||||
else
|
||||
(session[:user_return_to].nil?) ? client_root_path : session[:user_return_to].to_s
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
class ClientController < ApplicationController
|
||||
def current_user
|
||||
EppUser.last
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -2,6 +2,7 @@ module Shared::CommonDomain
|
|||
extend ActiveSupport::Concern
|
||||
|
||||
included do
|
||||
load_and_authorize_resource
|
||||
before_action :set_domain, only: [:show, :edit, :update, :destroy]
|
||||
before_action :verify_deletion, only: [:destroy]
|
||||
end
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
class SessionsController < Devise::SessionsController
|
||||
def create
|
||||
@user = User.find_by(identity_code: '37810013855')
|
||||
sign_in_and_redirect @user, :event => :authentication
|
||||
if Rails.env.development?
|
||||
@user = User.find_by(username: 'gitlab') if params[:gitlab]
|
||||
@user = User.find_by(username: 'zone') if params[:zone]
|
||||
sign_in_and_redirect @user, :event => :authentication
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
def login
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue