Compare commits

..

3 commits

Author SHA1 Message Date
Korbs
2f8f5d2750 update 2024-07-17 03:57:30 -04:00
Korbs
beac31c9ae Add note 2024-07-17 03:57:23 -04:00
Korbs
c16c43f2d4 Change if/else on checking if end-user is subscribed 2024-07-17 03:57:15 -04:00
4 changed files with 13 additions and 3 deletions

View file

@ -30,6 +30,8 @@ In the `.env` file that've you copied from `.env.example, you'll need to change
For production use, make sure to follow all instructions needed from https://supabase.com/docs/guides/self-hosting/docker. For production use, make sure to follow all instructions needed from https://supabase.com/docs/guides/self-hosting/docker.
> SMTP is required for email verification, as a code is required. The end-user is not allowed to login yet until their email is verified.
### Allowing Account Deletion ### Allowing Account Deletion
When an end-user wants to delete their account, they'll be directed to `/api/account/delete`. This API requires that a function already exist in your Supabase project called `delete_user()`. When an end-user wants to delete their account, they'll be directed to `/api/account/delete`. This API requires that a function already exist in your Supabase project called `delete_user()`.

View file

@ -1,5 +1,6 @@
--- ---
const { Title } = Astro.props const { Title } = Astro.props
import { ViewTransitions } from 'astro:transitions';
--- ---
<head> <head>
@ -7,3 +8,4 @@ const { Title } = Astro.props
<meta name="viewport" content="width=device-width, initial-scale=2.2" /> <meta name="viewport" content="width=device-width, initial-scale=2.2" />
<title>{Title}</title> <title>{Title}</title>
</head> </head>
<ViewTransitions />

View file

@ -22,7 +22,7 @@ export const POST: APIRoute = async ({ request, redirect }) => {
plan: "Free", plan: "Free",
theme: "Dark", theme: "Dark",
color_scheme: "Green", color_scheme: "Green",
beta: true beta: true,
} }
}, },
email, email,

View file

@ -10,13 +10,19 @@ let { data: subs } = await supabase
.select("*") .select("*")
.eq('UserSubscribed', id) .eq('UserSubscribed', id)
.eq('Id', CreatorId) .eq('Id', CreatorId)
if (subs[0] === undefined) {
var Subbed = false
} else {
var Subbed = true
}
--- ---
<Base Title="Supabase Demo"> <Base Title="Supabase Demo">
<div style="display: flex; justify-content: space-between; align-items: center;"> <div style="display: flex; justify-content: space-between; align-items: center;">
<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 ? {Subbed ?
<a style="font-size: 14px;" href={"/api/account/subscription/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/subscription/add?=" + 'C6nSFpj9HTCZ5t-N3Rm3-HA'}>Subscribe</a> <a style="font-size: 14px;" href={"/api/account/subscription/add?=" + 'C6nSFpj9HTCZ5t-N3Rm3-HA'}>Subscribe</a>