Allow any email to register and fix logout blank page bug

This commit is contained in:
Christian Vidal Wolf
2026-04-09 09:58:01 +02:00
parent ec541f1238
commit f125572572
3 changed files with 3 additions and 12 deletions
-9
View File
@@ -1,6 +1,5 @@
const SUPABASE_URL = 'https://hwithddwaapyhnfwcesj.supabase.co';
const SUPABASE_ANON_KEY = 'sb_publishable_fGXkh0bSrAOqSk2jWKAzSg_NJD9YPCv';
const ALLOWED_DOMAIN = '@craze-group.com';
const SESSION_KEY = 'craze_auth_session';
export interface AuthSession {
@@ -9,10 +8,6 @@ export interface AuthSession {
}
export async function signUp(email: string, password: string): Promise<void> {
if (!email.toLowerCase().endsWith(ALLOWED_DOMAIN)) {
throw new Error(`Only ${ALLOWED_DOMAIN} email addresses are allowed.`);
}
const response = await fetch(`${SUPABASE_URL}/auth/v1/signup`, {
method: 'POST',
headers: {
@@ -29,10 +24,6 @@ export async function signUp(email: string, password: string): Promise<void> {
}
export async function signIn(email: string, password: string): Promise<AuthSession> {
if (!email.toLowerCase().endsWith(ALLOWED_DOMAIN)) {
throw new Error(`Only ${ALLOWED_DOMAIN} email addresses are allowed.`);
}
const response = await fetch(`${SUPABASE_URL}/auth/v1/token?grant_type=password`, {
method: 'POST',
headers: {