mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 20:36:39 +08:00
FIX: Redirect away from account-created
if you're logged in
This commit is contained in:
parent
12fb20fe1b
commit
81190f5d66
|
@ -533,6 +533,8 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def account_created
|
||||
return redirect_to("/") if current_user.present?
|
||||
|
||||
@custom_body_class = "static-account-created"
|
||||
@message = session['user_created_message'] || I18n.t('activation.missing_session')
|
||||
@account_created = { message: @message }
|
||||
|
|
|
@ -2008,6 +2008,12 @@ describe UsersController do
|
|||
expect(created[:username]).to be_blank
|
||||
end
|
||||
|
||||
it "redirects when the user is logged in" do
|
||||
log_in(:user)
|
||||
get :account_created
|
||||
expect(response).to be_redirect
|
||||
end
|
||||
|
||||
context "when the user account is created" do
|
||||
before do
|
||||
session['user_created_message'] = "Donuts"
|
||||
|
|
Loading…
Reference in New Issue
Block a user