Fix for upgrading directly after signing up

This commit is contained in:
Hillel Coren 2016-07-04 13:03:09 +03:00
parent 4a6673b25e
commit 6217419a2f

View File

@ -258,14 +258,17 @@ class UserController extends BaseController
return Redirect::to("/password/reset/{$token}"); return Redirect::to("/password/reset/{$token}");
} else { } else {
if (Session::has(REQUESTED_PRO_PLAN)) { if (Auth::check()) {
Session::forget(REQUESTED_PRO_PLAN); if (Session::has(REQUESTED_PRO_PLAN)) {
$invitation = $this->accountRepo->enableProPlan(); Session::forget(REQUESTED_PRO_PLAN);
$url = '/settings/account_management?upgrade=true';
return Redirect::to($invitation->getLink()); } else {
$url = '/dashboard';
}
} else { } else {
return Redirect::to(Auth::check() ? '/dashboard' : '/login')->with('message', $notice_msg); $url = '/login';
} }
return Redirect::to($url)->with('message', $notice_msg);
} }
} else { } else {
$error_msg = trans('texts.security.wrong_confirmation'); $error_msg = trans('texts.security.wrong_confirmation');