Automatically log the user in after user creation

This commit is contained in:
snipe 2016-11-29 01:19:25 -08:00
parent 0d6b160b61
commit 81a0e06c40

View file

@ -15,6 +15,7 @@ use Response;
use Artisan; use Artisan;
use Crypt; use Crypt;
use Mail; use Mail;
use Auth;
use App\Models\User; use App\Models\User;
use App\Http\Requests\SetupUserRequest; use App\Http\Requests\SetupUserRequest;
@ -184,6 +185,7 @@ class SettingsController extends Controller
return redirect()->back()->withInput()->withErrors($user->getErrors())->withErrors($settings->getErrors()); return redirect()->back()->withInput()->withErrors($user->getErrors())->withErrors($settings->getErrors());
} else { } else {
$user->save(); $user->save();
Auth::login($user, true);
$settings->save(); $settings->save();
if (Input::get('email_creds')=='1') { if (Input::get('email_creds')=='1') {
@ -195,6 +197,7 @@ class SettingsController extends Controller
} }
return redirect()->route('setup.done'); return redirect()->route('setup.done');
} }
@ -224,6 +227,7 @@ class SettingsController extends Controller
*/ */
public function getSetupDone() public function getSetupDone()
{ {
return View::make('setup/done') return View::make('setup/done')
->with('step', 4) ->with('step', 4)
->with('section', 'Done!'); ->with('section', 'Done!');