[Fix #1096] Sign in with GitHub page
This commit is contained in:
parent
7c0fdbc9f8
commit
4990595430
6 changed files with 39 additions and 3 deletions
|
@ -16,4 +16,8 @@
|
||||||
&.justify-between {
|
&.justify-between {
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.justify-center {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
11
app/assets/stylesheets/new_design/super_admin.scss
Normal file
11
app/assets/stylesheets/new_design/super_admin.scss
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
@import "constants";
|
||||||
|
|
||||||
|
.super-admin {
|
||||||
|
margin-top: 40px;
|
||||||
|
text-align: center;
|
||||||
|
|
||||||
|
h2 {
|
||||||
|
font-size: 24px;
|
||||||
|
margin-bottom: 4 * $default-spacer;
|
||||||
|
}
|
||||||
|
}
|
11
app/controllers/administrations/sessions_controller.rb
Normal file
11
app/controllers/administrations/sessions_controller.rb
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
class Administrations::SessionsController < ApplicationController
|
||||||
|
layout "new_application"
|
||||||
|
|
||||||
|
def new
|
||||||
|
end
|
||||||
|
|
||||||
|
def destroy
|
||||||
|
sign_out :administration if administration_signed_in?
|
||||||
|
redirect_to root_path
|
||||||
|
end
|
||||||
|
end
|
|
@ -13,4 +13,4 @@
|
||||||
%br
|
%br
|
||||||
|
|
||||||
.text-center
|
.text-center
|
||||||
= link_to 'Deconnexion', '/administrations/sign_out', method: :delete
|
= link_to 'Deconnexion', administrations_sign_out_path, method: :delete
|
||||||
|
|
6
app/views/administrations/sessions/new.html.haml
Normal file
6
app/views/administrations/sessions/new.html.haml
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
.super-admin.flex.justify-center
|
||||||
|
%div
|
||||||
|
%h2 Espace Admin
|
||||||
|
= link_to administration_github_omniauth_authorize_path, class: "button large" do
|
||||||
|
%span.icon.lock
|
||||||
|
Connexion avec GitHub
|
|
@ -2,8 +2,10 @@ Rails.application.routes.draw do
|
||||||
get "/ping" => "ping#index", :constraints => {:ip => /127.0.0.1/}
|
get "/ping" => "ping#index", :constraints => {:ip => /127.0.0.1/}
|
||||||
|
|
||||||
devise_for :administrations,
|
devise_for :administrations,
|
||||||
skip: [:password, :registrations],
|
skip: [:password, :registrations, :sessions],
|
||||||
controllers: { omniauth_callbacks: 'administrations/omniauth_callbacks' }
|
controllers: {
|
||||||
|
omniauth_callbacks: 'administrations/omniauth_callbacks'
|
||||||
|
}
|
||||||
|
|
||||||
devise_for :administrateurs, controllers: {
|
devise_for :administrateurs, controllers: {
|
||||||
sessions: 'administrateurs/sessions'
|
sessions: 'administrateurs/sessions'
|
||||||
|
@ -44,6 +46,8 @@ Rails.application.routes.draw do
|
||||||
get 'admin' => 'admin#index'
|
get 'admin' => 'admin#index'
|
||||||
get 'backoffice' => 'backoffice#index'
|
get 'backoffice' => 'backoffice#index'
|
||||||
|
|
||||||
|
get 'administrations/sign_in' => 'administrations/sessions#new'
|
||||||
|
delete 'administrations/sign_out' => 'administrations/sessions#destroy'
|
||||||
authenticate :administration do
|
authenticate :administration do
|
||||||
resources :administrations, only: [:index, :create]
|
resources :administrations, only: [:index, :create]
|
||||||
namespace :administrations do
|
namespace :administrations do
|
||||||
|
|
Loading…
Reference in a new issue