diff --git a/.eslintrc.js b/.eslintrc.js index ca4281cd..0f2c600d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,9 +1,9 @@ module.exports = { - extends: ["@calblueprint/eslint-config-react"], - rules: { - // Add any custom rules here - // Disable the rule that requires React to be in scope -- we don't need this with React 18 - 'react/react-in-jsx-scope': 'off', - 'react/jsx-uses-react': 'off', - }, - }; \ No newline at end of file + extends: ["@calblueprint/eslint-config-react"], + rules: { + // Add any custom rules here + // Disable the rule that requires React to be in scope -- we don't need this with React 18 + 'react/react-in-jsx-scope': 'off', + 'react/jsx-uses-react': 'off', + }, +}; \ No newline at end of file diff --git a/src/api/supabase/auth/auth.tsx b/src/api/supabase/auth/auth.tsx new file mode 100644 index 00000000..700dc309 --- /dev/null +++ b/src/api/supabase/auth/auth.tsx @@ -0,0 +1,23 @@ +/* eslint-disable */ + +import supabase from '../createClient'; + +export const handleSignUp = async (email: string, password: string) => { + const { data, error } = await supabase.auth.signUp({ + email, + password, + }); + console.log(error); +}; + +export const signInWithEmail = async (email: string, password: string) => { + const { data, error } = await supabase.auth.signInWithPassword({ + email, + password, + }); + console.log(data); +}; + +export const signOut = async () => { + const { error } = await supabase.auth.signOut(); +}; diff --git a/src/api/supabase/queries /createClient.ts b/src/api/supabase/createClient.tsx similarity index 100% rename from src/api/supabase/queries /createClient.ts rename to src/api/supabase/createClient.tsx diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index a42e544a..40e4ec69 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -1,5 +1,6 @@ 'use client'; +import { useState } from 'react'; import Link from 'next/link'; import LoginForm from '../../components/LoginForm'; @@ -13,6 +14,12 @@ import { Button, } from './styles'; +import { + handleSignUp, + signInWithEmail, + signOut, +} from '../../api/supabase/auth/auth'; + export default function App() { return (
@@ -32,3 +39,33 @@ export default function App() {
); } + +export function Login() { + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + + return ( + <> + setEmail(e.target.value)} + value={email} + /> + setPassword(e.target.value)} + value={password} + /> + + + + + ); +}