Implement authentication

This commit is contained in:
Jorge Vargas 2024-11-20 16:28:22 -06:00
parent cdcd71cf2a
commit 3e4551ea7a
23 changed files with 656 additions and 406 deletions

View file

@ -1,4 +1,3 @@
import type { Session } from '@auth/core/types'
import { useState } from 'react'
import { gql } from '@/graphql/__generated__/client'
import { useMutation } from '@apollo/client/react/hooks'
@ -15,13 +14,10 @@ const registerMutation = gql(`
}
`)
export default function RegisterBtn(props: { session: Session }) {
const { session } = props
export default function RegisterBtn() {
const [modalOpen, setModalOpen] = useState(false)
const [mutate, { loading }] = useMutation(registerMutation, { client: apolloClient, ignoreResults: true })
if (session) return null
const handleSubmit = (ev) => {
ev.preventDefault()
const formData = new FormData(ev.target)