BUGFIX: login was broken when login was required

This commit is contained in:
Régis Hanol
2014-07-26 23:16:08 +02:00
parent f66c39c63b
commit 3d6e2713d1
2 changed files with 15 additions and 2 deletions

View File

@ -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