<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lester MacDonald</title>
    <description>The latest articles on DEV Community by Lester MacDonald (@lmd).</description>
    <link>https://dev.to/lmd</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1993812%2Ff698219a-afb6-4abb-98f8-14b80f564e29.png</url>
      <title>DEV Community: Lester MacDonald</title>
      <link>https://dev.to/lmd</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lmd"/>
    <language>en</language>
    <item>
      <title>Laravel 11 Jetstream inertia redirect issue after closing browser tab and revisiting site</title>
      <dc:creator>Lester MacDonald</dc:creator>
      <pubDate>Wed, 28 Aug 2024 18:07:47 +0000</pubDate>
      <link>https://dev.to/lmd/laravel-11-jetstream-inertia-redirect-issue-after-closing-browser-tab-and-revisiting-site-3ab2</link>
      <guid>https://dev.to/lmd/laravel-11-jetstream-inertia-redirect-issue-after-closing-browser-tab-and-revisiting-site-3ab2</guid>
      <description>&lt;p&gt;Hi everyone, I am having a redirect issue when closing the browser tab without closing the browser and revisiting the site. I get redirected to Dashboard.&lt;/p&gt;

&lt;p&gt;This is the normal behavior however I have changed my home path to a view called timeline.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// config\fortify.php

'home' =&amp;gt; '/timeline',
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is my /routes/web.php&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

use Illuminate\Foundation\Application;
use Illuminate\Support\Facades\Route;
use Inertia\Inertia;
use App\Http\Controllers\TimelineController;
use App\Http\Controllers\DashboardController;

Route::get('/', function () {
    return redirect()-&amp;gt;route('login');
});

// A dynamic way to change the robots.txt depending on what environment your in.
Route::get('/robots.txt', function () {
    if (app()-&amp;gt;environment('production')) {
        return response("User-agent: *\nDisallow:", 200, ['Content-Type' =&amp;gt; 'text/plain']);
    } else {
        return response("User-agent: *\nDisallow: /", 200, ['Content-Type' =&amp;gt; 'text/plain']);
    }
});

Route::middleware([
    'auth:sanctum',
    config('jetstream.auth_session'),
    'verified',
])-&amp;gt;group(function () {
    Route::get('/timeline', [TimelineController::class, 'index'])-&amp;gt;name('timeline');
    Route::get('/dashboard', [DashboardController::class, 'index'])-&amp;gt;name('dashboard');
});

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With the help of ChatGPT I tried to narrow down where this redirect is happening with no luck. I'm guessing the session has something to do with it. It's a fresh install other than creating a new timeline.vue and redirecting the "/" route to the login page.&lt;/p&gt;

&lt;p&gt;Any help would be appreciated. Thanks.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
