title: Laravel 8 Redirect Authenticated User Until Data is Changed
body: <p>Seems like there are a lot of posts related to authentication and redirects, but I can't seem to find exactly what I need. I feel like it should be simple.</p>
  <p>So, we have a system whereby we want users to enable 2FA and change their passwords every 60 days. We are using Laravel 8 with Jetstream. I am doing a check on login (via modifying config/fortify.php), which works fine, if the password needs to be changed or if they don't have 2FA they get directed on login to their profile page and they see a message saying they need to update their details.</p>
  <p>The problem is they can then navigate to any other page without updating anything. Ideally I want them to be redirected back to the profile page until they update their info.</p>
  <p>We have the routes inside a middleware group:</p>
  <pre><code>Route::middleware(['auth:sanctum', 'verified'])-&gt;group(function() {
    routes here
  });
  </code></pre>
  <p>I thought I could just add a check before any routes load using Auth::user(), but the array is empty and therefore any vars accessed are null.</p>
  <p>Auth::users()-&gt;role;</p>
  <p>I was hoping for something like:</p>
  <pre><code>Route::middleware(['auth:sanctum', 'verified'])-&gt;group(function() {
    if (pass needs resetting and current route isn't profile) {
      redirect('/profile');
    }
  });
  </code></pre>
  <p>I'm assuming that Laravel doesn't authenticate the user until after the middleware has run? Not sure, but that would explain the null values.</p>
  <p>So, how would you guys accomplish this? Do I need to modify a controller instead? I just need the user to stay on their profile page until they have updated their data, then they can proceed as normal.</p>
  <p>Many thanks for your help.</p>