another commit without a list of specific changes! (misc)
This commit is contained in:
@@ -3,7 +3,9 @@ import MediaRequestForm from "@/components/TRip/MediaRequestForm"
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import Root from "@/components/AppLayout.jsx";
|
||||
import { verifyToken } from "@/utils/jwt";
|
||||
import { refreshAccessToken } from "@/utils/authFetch";
|
||||
import { ENVIRONMENT } from "@/config";
|
||||
import { requireAuthHook } from "@/hooks/requireAuthHook";
|
||||
|
||||
const token = Astro.cookies.get("access_token")?.value;
|
||||
let user = null;
|
||||
|
||||
@@ -3,26 +3,9 @@ import MediaRequestForm from "@/components/TRip/MediaRequestForm"
|
||||
import Base from "@/layouts/Base.astro";
|
||||
import Root from "@/components/AppLayout.jsx";
|
||||
import { verifyToken } from "@/utils/jwt";
|
||||
import { requireAuthHook } from "@/hooks/requireAuthHook";
|
||||
import { ENVIRONMENT } from "@/config";
|
||||
|
||||
const token = Astro.cookies.get("access_token")?.value;
|
||||
let user = null;
|
||||
|
||||
try {
|
||||
if (token) {
|
||||
user = verifyToken(token);
|
||||
if (user) {
|
||||
console.log("Verified!", user);
|
||||
} else {
|
||||
throw Error("Authentication required");
|
||||
}
|
||||
} else {
|
||||
throw Error("Authentication required");
|
||||
}
|
||||
} catch {
|
||||
return Astro.redirect('/login'
|
||||
);
|
||||
}
|
||||
---
|
||||
<Base>
|
||||
<section>
|
||||
|
||||
@@ -6,7 +6,7 @@ import Root from "@/components/AppLayout.jsx";
|
||||
<Base>
|
||||
<section>
|
||||
<div class="prose prose-neutral dark:prose-invert">
|
||||
<Root child="LoginPage" client:only="react">
|
||||
<Root child="LoginPage" client:only="react" >
|
||||
</Root>
|
||||
</section>
|
||||
</Base>
|
||||
@@ -9,7 +9,5 @@ import "@styles/player.css";
|
||||
<div class="prose prose-neutral dark:prose-invert">
|
||||
<Root child="Player" client:only="react">
|
||||
</Root>
|
||||
<script is:inline src="/scripts/jquery/dist/jquery.js" />
|
||||
<script is:inline src="/scripts/howler/dist/howler.js" />
|
||||
</section>
|
||||
</Base>
|
||||
|
||||
Reference in New Issue
Block a user