mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
admin login now honors seed file
This commit is contained in:
parent
0ccc70fcf4
commit
0ef51a12c4
2 changed files with 10 additions and 4 deletions
|
@ -3,7 +3,10 @@ class SessionsController < Devise::SessionsController
|
||||||
# TODO: Create ID Card login here:
|
# TODO: Create ID Card login here:
|
||||||
# this is just testing config
|
# this is just testing config
|
||||||
# if Rails.env.development? || Rails.env.test?
|
# if Rails.env.development? || Rails.env.test?
|
||||||
@user = User.find_by(username: 'gitlab') if params[:gitlab]
|
@user = User.first if params[:user1]
|
||||||
|
@user = User.second if params[:user2]
|
||||||
|
|
||||||
|
return redirect_to :back, alert: 'No user' if @user.blank?
|
||||||
|
|
||||||
session[:current_user_registrar_id] = Registrar.first.id if @user.admin?
|
session[:current_user_registrar_id] = Registrar.first.id if @user.admin?
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
%meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}/
|
%meta{:content => "IE=edge", "http-equiv" => "X-UA-Compatible"}/
|
||||||
%meta{:content => "width=device-width, initial-scale=1", :name => "viewport"}/
|
%meta{:content => "width=device-width, initial-scale=1", :name => "viewport"}/
|
||||||
%meta{:content => "Full stack top-level domain (TLD) management.", :name => "description"}/
|
%meta{:content => "Full stack top-level domain (TLD) management.", :name => "description"}/
|
||||||
%meta{:content => "Gitlab LTD", :name => "author"}/
|
%meta{:content => "Gitlab Ltd", :name => "author"}/
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true
|
||||||
= stylesheet_link_tag 'login', media: 'all', 'data-turbolinks-track' => true
|
= stylesheet_link_tag 'login', media: 'all', 'data-turbolinks-track' => true
|
||||||
|
@ -22,5 +22,8 @@
|
||||||
%hr
|
%hr
|
||||||
/ TODO: Refactor this when ID card login is done
|
/ TODO: Refactor this when ID card login is done
|
||||||
- if can? :create, :admin_session
|
- if can? :create, :admin_session
|
||||||
= button_to 'ID card (gitlab)', 'sessions',
|
= button_to 'ID card (user1)', 'sessions',
|
||||||
class: 'btn btn-lg btn-primary btn-block', name: 'gitlab'
|
class: 'btn btn-lg btn-primary btn-block', name: 'user1'
|
||||||
|
= button_to 'ID card (user2)', 'sessions',
|
||||||
|
class: 'btn btn-lg btn-primary btn-block', name: 'user2'
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue