Compare commits

..

3 commits

Author SHA1 Message Date
Korbs
75837fa2f7 Set to base 2024-07-17 03:34:11 -04:00
Korbs
54ca6d9424 Move some files around 2024-07-17 03:34:02 -04:00
Korbs
a234d4a934 Enable "checkOrigin" for Astro 2024-07-17 03:33:40 -04:00
12 changed files with 14 additions and 11 deletions

View file

@ -5,5 +5,8 @@ export default defineConfig({
output: "server", output: "server",
adapter: node({ adapter: node({
mode: "standalone" mode: "standalone"
}) }),
security: {
checkOrigin: true,
}
}) })

View file

@ -18,7 +18,7 @@ if (Astro.url.href.endsWith('PasswordReset')) {var MessagePasswordReset = true}
else {var MessagePasswordReset = false} else {var MessagePasswordReset = false}
// Supabase Data // Supabase Data
import { supabase } from "../library/supabase" import { supabase } from "@library/supabase"
const { data: { user } } = await supabase.auth.getUser() const { data: { user } } = await supabase.auth.getUser()
const avatarUrl = user?.user_metadata.avatar_url const avatarUrl = user?.user_metadata.avatar_url
const displayName = user?.user_metadata.full_name const displayName = user?.user_metadata.full_name
@ -79,9 +79,9 @@ const lastSignInDate = lastSignIn.toLocaleDateString('en-US', dateFormat)
<p>Theme: {user_theme}</p> <p>Theme: {user_theme}</p>
<p>Color Scheme: {user_color_scheme}</p> <p>Color Scheme: {user_color_scheme}</p>
{user_beta ? {user_beta ?
<form method="post" action="/api/account/beta-off"><button type="submit">Leave Beta</button></form> <form method="post" action="/api/account/preferences/beta-off"><button type="submit">Leave Beta</button></form>
: :
<form method="post" action="/api/account/beta-on"><button type="submit">Enter Beta</button></form> <form method="post" action="/api/account/preferences/beta-on"><button type="submit">Enter Beta</button></form>
} }
</p> </p>
<hr/> <hr/>

View file

@ -1,7 +1,7 @@
--- ---
import Base from "@layouts/Base.astro" import Base from "@layouts/Base.astro"
const CreatorId = Astro.url.href.split("add?=").pop() const CreatorId = Astro.url.href.split("add?=").pop()
import { supabase } from "../../../library/supabase" import { supabase } from "@library/supabase"
const { data: { user } } = await supabase.auth.getUser() const { data: { user } } = await supabase.auth.getUser()
const { data, error } = await supabase const { data, error } = await supabase
.from('subs') .from('subs')

View file

@ -1,7 +1,7 @@
--- ---
import Base from "@layouts/Base.astro" import Base from "@layouts/Base.astro"
const CreatorId = Astro.url.href.split("remove?=").pop() const CreatorId = Astro.url.href.split("remove?=").pop()
import { supabase } from "../../../library/supabase" import { supabase } from "@library/supabase"
const { data: { user } } = await supabase.auth.getUser() const { data: { user } } = await supabase.auth.getUser()
const id = user?.id const id = user?.id
const { data, error } = await supabase const { data, error } = await supabase

View file

@ -33,5 +33,5 @@ export const POST: APIRoute = async ({ request, redirect }) => {
return new Response(error.message, { status: 500 }) return new Response(error.message, { status: 500 })
} }
return redirect("/email-confirm") return redirect("/account/email-confirm")
} }

View file

@ -17,9 +17,9 @@ let { data: subs } = await supabase
<p style="font-size: 18px; font-weight: bold;">Vsause</p> <p style="font-size: 18px; font-weight: bold;">Vsause</p>
<div> <div>
{subs[0].Subscribed ? {subs[0].Subscribed ?
<a style="font-size: 14px;" href={"/api/account/remove?=" + 'C6nSFpj9HTCZ5t-N3Rm3-HA'}>Unsubscribe</a> <a style="font-size: 14px;" href={"/api/account/subscription/remove?=" + 'C6nSFpj9HTCZ5t-N3Rm3-HA'}>Unsubscribe</a>
: :
<a style="font-size: 14px;" href={"/api/account/add?=" + 'C6nSFpj9HTCZ5t-N3Rm3-HA'}>Subscribe</a> <a style="font-size: 14px;" href={"/api/account/subscription/add?=" + 'C6nSFpj9HTCZ5t-N3Rm3-HA'}>Subscribe</a>
} }
</div> </div>
</div> </div>

View file

@ -9,7 +9,7 @@ if (Astro.cookies.get('sb-access-token') && Astro.cookies.get('sb-refresh-token'
} }
// Supabase Data // Supabase Data
import { supabase } from "../library/supabase" import { supabase } from "@library/supabase"
const { data: { user } } = await supabase.auth.getUser() const { data: { user } } = await supabase.auth.getUser()
const avatar = user?.user_metadata.avatar_url const avatar = user?.user_metadata.avatar_url
const displayName = user?.user_metadata.full_name const displayName = user?.user_metadata.full_name

View file

@ -1,5 +1,5 @@
{ {
"extends": "astro/tsconfigs/strictest", "extends": "astro/tsconfigs/base",
"compilerOptions": { "compilerOptions": {
"baseUrl": ".", "baseUrl": ".",
"paths": { "paths": {