refactor(#29): remove stripe sign up logic

This commit is contained in:
OllyNicholass
2024-09-17 19:39:06 +01:00
parent ec456a9b22
commit e1df81f104
-19
View File
@@ -1,6 +1,4 @@
<script lang="ts">
import stripe from 'stripe';
import { PUBLIC_STRIPE_SECRET_KEY } from '$env/static/public';
let email = '';
let password = '';
@@ -8,8 +6,6 @@
// Access the supabase client from the layout data
export let supabase: any;
const stripeClient = new stripe(PUBLIC_STRIPE_SECRET_KEY);
async function signUpNewUser() {
try {
const { data, error } = await supabase.auth.signUp({
@@ -25,21 +21,6 @@
throw error;
}
const customer = await stripeClient.customers.create({
email
});
const response = await supabase
.from('user')
.update({
customer_id: customer.id
})
.match({
id: data.user.id
});
console.log(response);
// Handle success (optional)
} catch (error: any) {
console.error('Sign up error:', error.message);