From 8a8dec550b2eaffa402968bf0bbd0d681fe0a805 Mon Sep 17 00:00:00 2001 From: Robin Ward Date: Thu, 25 May 2017 13:35:15 -0400 Subject: [PATCH] FIX: If login is required, redirect to the `/login` route instead of root --- app/controllers/users/omniauth_callbacks_controller.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 8809e94d4c0..c6017c3ef21 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -54,7 +54,9 @@ class Users::OmniauthCallbacksController < ApplicationController end unless @origin.present? - @origin = Discourse.base_uri("/") + @origin = SiteSetting.login_required? ? + Discourse.base_uri("/login") : + Discourse.base_uri("/") end if @auth_result.failed?