Skip to content

Commit

Permalink
Minor changes to improve SPA compatibility (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Bindoff authored Dec 18, 2020
1 parent dcc66cd commit 4263e3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function store(LoginRequest $request)
*/
public function destroy(Request $request)
{
Auth::logout();
Auth::guard('web')->logout();

$request->session()->invalidate();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use App\Providers\RouteServiceProvider;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\ValidationException;

class ConfirmablePasswordController extends Controller
{
Expand All @@ -24,15 +25,15 @@ public function show(Request $request)
* Confirm the user's password.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\RedirectResponse
* @return mixed
*/
public function store(Request $request)
{
if (! Auth::validate([
if (! Auth::guard('web')->validate([
'email' => $request->user()->email,
'password' => $request->password,
])) {
return back()->withErrors([
throw ValidationException::withMessages([
'password' => __('auth.password'),
]);
}
Expand Down

0 comments on commit 4263e3d

Please sign in to comment.