mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -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
|
def show
|
||||||
|
|
||||||
|
return redirect_to('/') if current_user && params[:id] == 'login'
|
||||||
|
|
||||||
map = {
|
map = {
|
||||||
"faq" => "faq_url",
|
"faq" => "faq_url",
|
||||||
"tos" => "tos_url",
|
"tos" => "tos_url",
|
||||||
|
|
|
@ -2,6 +2,7 @@ require 'spec_helper'
|
||||||
|
|
||||||
describe StaticController do
|
describe StaticController do
|
||||||
|
|
||||||
|
context 'show' do
|
||||||
context "with a static file that's present" do
|
context "with a static file that's present" do
|
||||||
|
|
||||||
before do
|
before do
|
||||||
|
@ -52,6 +53,14 @@ describe StaticController do
|
||||||
end
|
end
|
||||||
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
|
describe '#enter' do
|
||||||
context 'without a redirect path' do
|
context 'without a redirect path' do
|
||||||
it 'redirects to the root url' do
|
it 'redirects to the root url' do
|
||||||
|
|
Loading…
Reference in a new issue