Skip to content

Commit a2b8ff2

Browse files
committed
Fix auth redirect issue and enforce trailing slash
1 parent dd21ce3 commit a2b8ff2

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

astro.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import react from "@astrojs/react";
77
export default defineConfig({
88
site: "https://derwebcoder.github.io",
99
base: "sparktag",
10+
trailingSlash: "always",
1011
integrations: [
1112
tailwind({
1213
// disabling this because we have the src/styles/global.css file including the base styles,

src/layouts/BaseLayout.astro

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,11 @@ const { title } = Astro.props;
2626
<script>
2727
import { isAuthenticated } from "../scripts/auth/secret";
2828

29-
const authUrl = import.meta.env.BASE_URL + "/auth";
30-
if (window.location.pathname === authUrl || (await isAuthenticated())) {
29+
const authUrl = import.meta.env.BASE_URL + "auth/";
30+
if (
31+
window.location.pathname.startsWith(authUrl) ||
32+
(await isAuthenticated())
33+
) {
3134
document.body.classList.remove("hidden");
3235
} else {
3336
window.location.href = authUrl;

0 commit comments

Comments
 (0)