Commit 3edac18c authored by Gabriel Mazetto's avatar Gabriel Mazetto

Removing ActionView::Helpers::UrlHelper include as this has side effects

Fixed first login flash notice after login from Geo primary
parent 3e87f537
......@@ -2,7 +2,6 @@
#
# Automatically sets the layout and ensures an administrator is logged in
class Admin::ApplicationController < ApplicationController
include ActionView::Helpers::UrlHelper
before_action :authenticate_admin!
before_action :display_geo_information
layout 'admin'
......@@ -13,7 +12,8 @@ class Admin::ApplicationController < ApplicationController
def display_geo_information
return unless Gitlab::Geo.secondary?
primary_node = link_to('primary node', Gitlab::Geo.primary_node.url)
primary_node = view_context.link_to('primary node', Gitlab::Geo.primary_node.url)
flash.now[:notice] = "You are on a secondary (read-only) Geo node. If you want to make any changes, you must visit the #{primary_node}.".html_safe
end
end
class Oauth::GeoAuthController < ActionController::Base
include ActionView::Helpers::UrlHelper
rescue_from Gitlab::Geo::OauthApplicationUndefinedError, with: :undefined_oauth_application
rescue_from OAuth2::Error, with: :auth
......@@ -47,8 +46,8 @@ class Oauth::GeoAuthController < ActionController::Base
def after_sign_in_with_gitlab(token, return_to)
if Gitlab::Geo.primary_node
primary_node = link_to('primary node', Gitlab::Geo.primary_node.url)
flash.now[:notice] = "You are on a secondary (read-only) Geo node. If you want to make any changes, you must visit the #{primary_node}.".html_safe
primary_node = view_context.link_to('primary node', Gitlab::Geo.primary_node.url)
flash[:notice] = "You are on a secondary (read-only) Geo node. If you want to make any changes, you must visit the #{primary_node}.".html_safe
end
session[:access_token] = token
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment