Fix redirect loop on session expiry and add missing nav links
- Add redirectGuestsTo in bootstrap/app.php so unauthenticated users always redirect to the full account login URL instead of a relative /login that would 404 on the admin subdomain or loop - Create HandleInertiaRequests middleware to share auth.user, flash messages, and domain config to all Vue pages (was entirely missing) - Add Profile nav link in AppLayout, "Customer View" link in AdminLayout - Point logout to account subdomain where Fortify routes live - Link AuthLayout logo back to marketing site - Fix Marketing/Home links to use full account subdomain URLs - Update RoleBasedAccessTest to match new redirect URL Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
<script setup>
|
||||
import { Link, usePage } from '@inertiajs/vue3';
|
||||
import { computed } from 'vue';
|
||||
import FlashMessages from '@/Components/FlashMessages.vue';
|
||||
|
||||
const page = usePage();
|
||||
const user = page.props.auth?.user;
|
||||
const user = computed(() => page.props.auth?.user);
|
||||
const domains = computed(() => page.props.domains);
|
||||
const accountUrl = computed(() => `https://${domains.value?.account}`);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -24,10 +28,17 @@ const user = page.props.auth?.user;
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center space-x-4">
|
||||
<a
|
||||
v-if="user"
|
||||
:href="accountUrl + '/dashboard'"
|
||||
class="text-sm text-gray-400 hover:text-white"
|
||||
>
|
||||
Customer View
|
||||
</a>
|
||||
<span v-if="user" class="text-sm text-gray-300">{{ user.name }}</span>
|
||||
<Link
|
||||
v-if="user"
|
||||
href="/logout"
|
||||
:href="accountUrl + '/logout'"
|
||||
method="post"
|
||||
as="button"
|
||||
class="text-sm text-gray-400 hover:text-white"
|
||||
@@ -40,6 +51,7 @@ const user = page.props.auth?.user;
|
||||
</nav>
|
||||
|
||||
<main class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
||||
<FlashMessages />
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
<script setup>
|
||||
import { Link, usePage } from '@inertiajs/vue3';
|
||||
import { computed } from 'vue';
|
||||
import FlashMessages from '@/Components/FlashMessages.vue';
|
||||
|
||||
const page = usePage();
|
||||
const user = page.props.auth?.user;
|
||||
const user = computed(() => page.props.auth?.user);
|
||||
const domains = computed(() => page.props.domains);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -21,6 +24,12 @@ const user = page.props.auth?.user;
|
||||
>
|
||||
Dashboard
|
||||
</Link>
|
||||
<Link
|
||||
href="/profile"
|
||||
class="px-3 py-2 rounded-md text-sm font-medium text-gray-700 hover:text-gray-900 hover:bg-gray-100"
|
||||
>
|
||||
Profile
|
||||
</Link>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-center space-x-4">
|
||||
@@ -40,6 +49,7 @@ const user = page.props.auth?.user;
|
||||
</nav>
|
||||
|
||||
<main class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
||||
<FlashMessages />
|
||||
<slot />
|
||||
</main>
|
||||
</div>
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
<script setup>
|
||||
import { usePage } from '@inertiajs/vue3';
|
||||
import { computed } from 'vue';
|
||||
|
||||
const page = usePage();
|
||||
const domains = computed(() => page.props.domains);
|
||||
const marketingUrl = computed(() => `https://${domains.value?.marketing}`);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="min-h-screen flex flex-col items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
|
||||
<div class="w-full max-w-md">
|
||||
<div class="text-center mb-8">
|
||||
<h1 class="text-3xl font-bold text-gray-900">EZSCALE</h1>
|
||||
<a :href="marketingUrl" class="text-3xl font-bold text-gray-900">EZSCALE</a>
|
||||
<p class="mt-2 text-sm text-gray-600">Cloud Hosting Platform</p>
|
||||
</div>
|
||||
<div class="bg-white shadow-sm rounded-lg border border-gray-200 p-8">
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
<script setup>
|
||||
import { usePage } from '@inertiajs/vue3';
|
||||
import { computed } from 'vue';
|
||||
|
||||
const page = usePage();
|
||||
const domains = computed(() => page.props.domains);
|
||||
const accountUrl = computed(() => `https://${domains.value?.account}`);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -8,8 +14,8 @@
|
||||
<div class="flex justify-between h-16 items-center">
|
||||
<span class="text-xl font-bold text-gray-900">EZSCALE</span>
|
||||
<div class="space-x-4">
|
||||
<a href="/login" class="text-sm text-gray-600 hover:text-gray-900">Sign in</a>
|
||||
<a href="/register" class="text-sm px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700">Get Started</a>
|
||||
<a :href="accountUrl + '/login'" class="text-sm text-gray-600 hover:text-gray-900">Sign in</a>
|
||||
<a :href="accountUrl + '/register'" class="text-sm px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700">Get Started</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -25,7 +31,7 @@
|
||||
VPS, Dedicated Servers, Web Hosting, and Game Servers. Powered by EZSCALE.
|
||||
</p>
|
||||
<div class="mt-10">
|
||||
<a href="/register" class="px-8 py-3 bg-blue-600 text-white font-medium rounded-md hover:bg-blue-700 text-lg">
|
||||
<a :href="accountUrl + '/register'" class="px-8 py-3 bg-blue-600 text-white font-medium rounded-md hover:bg-blue-700 text-lg">
|
||||
Start Free Trial
|
||||
</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user