explicitly call #omniauth_fail

This commit is contained in:
Joshua Arts 2018-07-23 12:07:26 -04:00
parent 40cb48a10a
commit 00a3deec29
2 changed files with 3 additions and 2 deletions

View File

@ -25,10 +25,11 @@ class SessionsController < ApplicationController
login(user)
rescue => e
logger.error "Error authenticating via omniauth: #{e}"
omniauth_fail
end
# POST /auth/failure
def fail
def omniauth_fail
redirect_to root_path, notice: I18n.t(params[:message], default: I18n.t("omniauth_error"))
end

View File

@ -26,7 +26,7 @@ Rails.application.routes.draw do
# Handles Omniauth authentication.
match '/auth/:provider/callback', to: 'sessions#omniauth', via: [:get, :post], as: :omniauth_session
get '/auth/failure', to: 'sessions#fail'
get '/auth/failure', to: 'sessions#omniauth_fail'
# Room resources.
resources :rooms, only: [:create, :show, :destroy], param: :room_uid, path: '/'