mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 04:41:25 +08:00
BUGFIX: login was broken when login was required
This commit is contained in:
@ -4,7 +4,6 @@ class StaticController < ApplicationController
|
||||
skip_before_filter :verify_authenticity_token, only: [:enter]
|
||||
|
||||
def show
|
||||
|
||||
return redirect_to('/') if current_user && params[:id] == 'login'
|
||||
|
||||
map = {
|
||||
@ -36,6 +35,15 @@ class StaticController < ApplicationController
|
||||
return
|
||||
end
|
||||
|
||||
file = "static/#{@page}.#{I18n.locale}"
|
||||
file = "static/#{@page}.en" if lookup_context.find_all("#{file}.html").empty?
|
||||
file = "static/#{@page}" if lookup_context.find_all("#{file}.html").empty?
|
||||
|
||||
if lookup_context.find_all("#{file}.html").any?
|
||||
render file, layout: !request.xhr?, formats: [:html]
|
||||
return
|
||||
end
|
||||
|
||||
raise Discourse::NotFound
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user