Skip to content

Commit

Permalink
Fixes Login event firing before Register (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
Quirinus authored Apr 8, 2021
1 parent 823e73b commit 9177b80
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,16 @@ public function store(Request $request)
'password' => 'required|string|confirmed|min:8',
]);

Auth::login($user = User::create([
$user = User::create([
'name' => $request->name,
'email' => $request->email,
'password' => Hash::make($request->password),
]));
]);

event(new Registered($user));

Auth::login($user);

return redirect(RouteServiceProvider::HOME);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,16 @@ public function store(Request $request)
'password' => 'required|string|confirmed|min:8',
]);

Auth::login($user = User::create([
$user = User::create([
'name' => $request->name,
'email' => $request->email,
'password' => Hash::make($request->password),
]));
]);

event(new Registered($user));

Auth::login($user);

return redirect(RouteServiceProvider::HOME);
}
}

0 comments on commit 9177b80

Please sign in to comment.