Fortify authentication succeeds, session is updated, controller method assigned to the redirected route fires and loads the view, app-layout with passed-in content is generated, but the login page never gets replaced. Application is built with Laravel Mix, but I've got all the components excluded from the build to narrow things down.
The content is visible in the inspector console and the request response. Status=200 but page never displays.
If I put the path for the redirect target into the address bar after authenticating, the page displays correctly. This only happens for the initial post-auth redirect.
Any ideas what to try or places to look? I'm losing my mind and my friends... family may be next.
I've stripped things down to just get a basic redirected target, but it still renders only in the console.
Console output
Fortify Provider:
public function register(): void
{
$this->app->instance(LoginResponse::class, new class implements LoginResponse {
public function toResponse($request)
{
$user = $request->user();
$user->last_login = now();
$user->save();
// Set session and redirect
if ($user->hasRole('ServerAdmin')) {
return redirect()->intended('/server/home');
} else {
return redirect()->intended('/home');
}
}
});
}
Controller Redirect: ...
return view('globaladmin.home');
GlobalAdmin Home Blade:
@extends('layouts.app')
@section('page_title')
{{ "Testing" }}
@endsection
@section('content')
<h1>Hello Admin Page</h1>
@endsection
Layout blade:
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<title>Testing</title>
<link rel="icon" href="{!! asset('images/favicon.ico') !!}"/>
<!-- Fonts -->
<link rel="dns-prefetch" href="//fonts.gstatic">
<link href="; rel="stylesheet">
<link href=":100,300,400,500,700,900" rel="stylesheet">
<link href="/@mdi/font@latest/css/materialdesignicons.min.css" rel="stylesheet">
<!-- Scripts -->
<script src="{{ asset('js/app.js') }}"></script>
<!-- Styles -->
<link rel="stylesheet" href="{{ asset('/css/app.css') }}">
</head>
<body class="body-container">
<div class="main_content">
@yield('content')
</div>
</body>
</html>