From 6217419a2ff3c9b51db24a3fadf3e29ed2c26a33 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 4 Jul 2016 13:03:09 +0300 Subject: [PATCH] Fix for upgrading directly after signing up --- app/Http/Controllers/UserController.php | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index ed5ff73084..44f77778bb 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -257,15 +257,18 @@ class UserController extends BaseController $token = Password::getRepository()->create($user); return Redirect::to("/password/reset/{$token}"); - } else { - if (Session::has(REQUESTED_PRO_PLAN)) { - Session::forget(REQUESTED_PRO_PLAN); - $invitation = $this->accountRepo->enableProPlan(); - - return Redirect::to($invitation->getLink()); + } else { + if (Auth::check()) { + if (Session::has(REQUESTED_PRO_PLAN)) { + Session::forget(REQUESTED_PRO_PLAN); + $url = '/settings/account_management?upgrade=true'; + } else { + $url = '/dashboard'; + } } else { - return Redirect::to(Auth::check() ? '/dashboard' : '/login')->with('message', $notice_msg); + $url = '/login'; } + return Redirect::to($url)->with('message', $notice_msg); } } else { $error_msg = trans('texts.security.wrong_confirmation');