mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 18:05:24 +02:00
Allow any email to register and fix logout blank page bug
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user