mirror of
https://github.com/supabase/supabase.git
synced 2026-07-04 10:35:03 +08:00
63 lines
1.7 KiB
Plaintext
63 lines
1.7 KiB
Plaintext
---
|
||
id: auth-signup
|
||
title: 'auth.signUp()'
|
||
slug: auth-signup
|
||
custom_edit_url: https://github.com/supabase/supabase/edit/master/web/spec/dart.yml
|
||
---
|
||
|
||
import Tabs from '@theme/Tabs'
|
||
import TabsPanel from '@theme/TabsPanel'
|
||
|
||
Creates a new user.
|
||
|
||
<Tabs
|
||
defaultActiveId="dart"
|
||
groupId="reference/dart"
|
||
values={[{ label: 'Dart', value: 'dart' }]}>
|
||
|
||
<TabsPanel id="dart" label="dart">
|
||
|
||
```dart
|
||
final res = await supabase.auth.signUp('example@email.com', 'example-password');
|
||
|
||
final user = res.data?.user;
|
||
final error = res.error;
|
||
```
|
||
|
||
</TabsPanel>
|
||
|
||
</Tabs>
|
||
|
||
## Notes
|
||
|
||
- By default, the user will need to verify their email address before logging in. If you would like to change this, you can disable "Email Confirmations" by going to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
|
||
- If "Email Confirmations" is turned on, a `user` is returned but `session` will be null
|
||
- If "Email Confirmations" is turned off, both a `user` and a `session` will be returned
|
||
- When the user confirms their email address, they will be redirected to localhost:3000 by default. To change this, you can go to Authentication -> Settings on [app.supabase.com](https://app.supabase.com)
|
||
|
||
## Examples
|
||
|
||
### Sign up.
|
||
|
||
<Tabs
|
||
defaultActiveId="dart"
|
||
groupId="reference/dart"
|
||
values={[{ label: 'Dart', value: 'dart' }]}>
|
||
|
||
<TabsPanel id="dart" label="dart">
|
||
|
||
```dart
|
||
final res = await supabase.auth.signUp('example@email.com', 'example-password');
|
||
|
||
final user = res.data?.user;
|
||
final error = res.error;
|
||
```
|
||
|
||
</TabsPanel>
|
||
|
||
</Tabs>
|
||
|
||
### Sign up with third-party providers.
|
||
|
||
If you are using Flutter, you can sign up with OAuth providers using the [`signInWithProvider()`](/docs/reference/dart/auth-signinwithprovider) method available on `supabase_flutter`.
|