supabase-community / auth-ui

Pre-built Auth UI for React
https://supabase.com/docs/guides/auth/auth-helpers/auth-ui
MIT License
470 stars 118 forks source link

fix(auth-ui-svelte): make additionalData prop optional #217

Closed sergejcodes closed 9 months ago

sergejcodes commented 10 months ago

What kind of change does this PR introduce?

Bug fix

Previous behavior: TypeScript shows an error if the additionalData prop is not explicitly set on the Svelte Auth component.

Since additionalData is defined as optional in shared/src/types.ts it makes sense to also make it optional for the Svelte Auth component.

error

What is the new behavior?

The additionalData prop for the Svelte Auth component is now optional and doesn't need to be explicitly set. This prevents a scenario like this in TypeScript:

<script lang="ts">
  import { Auth } from '@supabase/auth-ui-svelte'
</script>

<Auth additionalData={undefined} />
Blackwidow-sudo commented 10 months ago

Good to see that there is already a PR. I was following https://supabase.com/docs/guides/getting-started/tutorials/with-sveltekit#set-up-a-login-page and this error was annoying.

silentworks commented 9 months ago

Thank you for this PR.