MCPcopy Create free account
hub / github.com/awkweb/react-supabase / useSignUp

Function useSignUp

src/hooks/auth/use-signup.ts:30–49  ·  view source on GitHub ↗
(config: UseSignUpConfig = {})

Source from the content-addressed store, hash-verified

28}
29
30export function useSignUp(config: UseSignUpConfig = {}): UseSignUpResponse {
31 const client = useClient()
32 const [state, setState] = useState<UseSignUpState>(initialState)
33
34 const execute = useCallback(
35 async (credentials: UserCredentials, options?: UseSignUpOptions) => {
36 setState({ ...initialState, fetching: true })
37 const { error, session, user } = await client.auth.signUp(
38 credentials,
39 options ?? config.options,
40 )
41 const res = { error, session, user }
42 setState({ ...res, fetching: false })
43 return res
44 },
45 [client, config],
46 )
47
48 return [state, execute]
49}

Callers 1

Calls 1

useClientFunction · 0.90

Tested by

no test coverage detected