diff --git a/app/controllers/admin/sign_ins_controller.rb b/app/controllers/admin/sign_ins_controller.rb new file mode 100644 index 00000000..1d32e32b --- /dev/null +++ b/app/controllers/admin/sign_ins_controller.rb @@ -0,0 +1,3 @@ +class Admin::SignInsController < ApplicationController + def show; end +end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index a7ada9bd..ddfe03b6 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -20,7 +20,11 @@ class ApplicationController < ActionController::Base rescue_from 'UnauthorizedError::RedirectToLogin' do store_location - redirect_to sign_in_path + if store_location == "/admin" + redirect_to admin_sign_in_path + else + redirect_to sign_in_path + end end rescue_from 'UnauthorizedError::UserNotFound' do |error| diff --git a/app/controllers/saml_authentications_controller.rb b/app/controllers/saml_authentications_controller.rb index d473ca23..81889ac0 100644 --- a/app/controllers/saml_authentications_controller.rb +++ b/app/controllers/saml_authentications_controller.rb @@ -4,11 +4,7 @@ def create if user session[:user_id] = user.id - - redirect_to( - admin_path, - notice: t('omniauth_callbacks.success') - ) + redirect_to admin_path, notice: t('omniauth_callbacks.success') else redirect_to( root_path, diff --git a/app/views/admin/sign_ins/show.html.erb b/app/views/admin/sign_ins/show.html.erb new file mode 100644 index 00000000..59cd2b69 --- /dev/null +++ b/app/views/admin/sign_ins/show.html.erb @@ -0,0 +1,17 @@ +<% content_for :title do %>18F Micro-purchase - Admin Login<% end %> + +
+ <%= link_to 'Authorize with GitHub', + '/auth/github', + class: 'usa-button usa-button usa-button-outline' %> +
+