mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 16:31:09 +08:00
Redirect to root after login if no path provided
If we do not do this, then people that login from /login will just be redirected back to the login page. We'd rather have them see the root path.
This commit is contained in:
@ -24,4 +24,26 @@ describe StaticController do
|
||||
end
|
||||
end
|
||||
|
||||
describe '#enter' do
|
||||
context 'without a redirect path' do
|
||||
it 'redirects to the root url' do
|
||||
xhr :post, :enter
|
||||
expect(response).to redirect_to root_path
|
||||
end
|
||||
end
|
||||
|
||||
context 'with a redirect path' do
|
||||
it 'redirects to the redirect path' do
|
||||
xhr :post, :enter, redirect: '/foo'
|
||||
expect(response).to redirect_to '/foo'
|
||||
end
|
||||
end
|
||||
|
||||
context 'when the redirect path is the login page' do
|
||||
it 'redirects to the root url' do
|
||||
xhr :post, :enter, redirect: login_path
|
||||
expect(response).to redirect_to root_path
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user