mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
On sites with login_required enabled, after signup, don't show the /login page again
This commit is contained in:
parent
704adc00ca
commit
ce5ebc3eb5
2 changed files with 44 additions and 33 deletions
|
@ -5,6 +5,8 @@ class StaticController < ApplicationController
|
|||
|
||||
def show
|
||||
|
||||
return redirect_to('/') if current_user && params[:id] == 'login'
|
||||
|
||||
map = {
|
||||
"faq" => "faq_url",
|
||||
"tos" => "tos_url",
|
||||
|
|
|
@ -2,6 +2,7 @@ require 'spec_helper'
|
|||
|
||||
describe StaticController do
|
||||
|
||||
context 'show' do
|
||||
context "with a static file that's present" do
|
||||
|
||||
before do
|
||||
|
@ -52,6 +53,14 @@ describe StaticController do
|
|||
end
|
||||
end
|
||||
|
||||
it 'should redirect to / when logged in and path is /login' do
|
||||
log_in
|
||||
xhr :get, :show, id: 'login'
|
||||
response.should redirect_to '/'
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
describe '#enter' do
|
||||
context 'without a redirect path' do
|
||||
it 'redirects to the root url' do
|
||||
|
|
Loading…
Reference in a new issue