mirror of
https://github.com/internetee/registry.git
synced 2025-07-19 17:25:57 +02:00
Merge branch 'master' of github.com:internetee/registry
Conflicts: db/schema.rb
This commit is contained in:
commit
641522ff08
31 changed files with 513 additions and 30 deletions
|
@ -2,4 +2,12 @@ class ApplicationController < ActionController::Base
|
|||
# Prevent CSRF attacks by raising an exception.
|
||||
# For APIs, you may want to use :null_session instead.
|
||||
protect_from_forgery with: :exception
|
||||
|
||||
def after_sign_in_path_for(resource)
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
14
app/controllers/sessions_controller.rb
Normal file
14
app/controllers/sessions_controller.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
class SessionsController < Devise::SessionsController
|
||||
def create
|
||||
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
|
||||
render 'layouts/login', layout: false
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue