mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Implement authentication
This commit is contained in:
parent
cdcd71cf2a
commit
3e4551ea7a
23 changed files with 656 additions and 406 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue