Skip to content

Commit

Permalink
fix: handle signUp endpoint disabled case
Browse files Browse the repository at this point in the history
  • Loading branch information
root5427 authored Dec 23, 2024
1 parent 207130b commit 8410502
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/runtime/composables/local/useAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,16 @@ async function getSession(getSessionOptions?: GetSessionOptions): Promise<Sessio

async function signUp(credentials: Credentials, signInOptions?: SecondarySignInOptions, signUpOptions?: SignUpOptions) {
const nuxt = useNuxtApp()
const runtimeConfig = useRuntimeConfig()
const config = useTypedBackendConfig(runtimeConfig, 'local')

const signUpEndpoint = config.endpoints.signUp

if (!signUpEndpoint) {
return
}

const { path, method } = useTypedBackendConfig(useRuntimeConfig(), 'local').endpoints.signUp
const { path, method } = signUpEndpoint
await _fetch(nuxt, path, {
method,
body: credentials
Expand Down

0 comments on commit 8410502

Please sign in to comment.