Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix: remove try/catch block from auth sample code

dshukertjr76718673a8d1
diff --git a/apps/reference/_supabase_dart/generated/auth-signin.mdx b/apps/reference/_supabase_dart/generated/auth-signin.mdx
index fb17e0bbb7a..428f2fc9a2f 100644
--- a/apps/reference/_supabase_dart/generated/auth-signin.mdx
+++ b/apps/reference/_supabase_dart/generated/auth-signin.mdx
@@ -47,11 +47,7 @@ try {
If email is provided, but no password is provided, the user will be sent a "magic link" to their email address, which they can click to open your application with a valid session. By default, a given user can only request a Magic Link once every 60 seconds.
```dart
-try {
- final res = await supabase.auth.signIn(email: '[email protected]');
-} catch (error) {
- // handle error
-}
+final res = await supabase.auth.signIn(email: '[email protected]');
```
### Get OAuth sign in URL.
@@ -60,11 +56,7 @@ Passing provider parameter to `signIn()` will return a URL to sign your user in
If you are looking to sign in a user via OAuth on Flutter app, go to [`signInWithProvider()`](/docs/reference/dart/auth-signinwithprovider).
```dart
-try {
- final res = await supabase.auth.signIn(provider: Provider.github);
+final res = await supabase.auth.signIn(provider: Provider.github);
- final user = res.user;
-} catch (error) {
- // handle error
-}
+final user = res.user;
```
diff --git a/apps/reference/_supabase_dart/generated/auth-signinwithprovider.mdx b/apps/reference/_supabase_dart/generated/auth-signinwithprovider.mdx
index 3ec3127ad61..35a5a24b0aa 100644
--- a/apps/reference/_supabase_dart/generated/auth-signinwithprovider.mdx
+++ b/apps/reference/_supabase_dart/generated/auth-signinwithprovider.mdx
@@ -41,14 +41,10 @@ Specify the redirect link to bring back the user via deeplink.
Note that `redirectTo` should be null for Flutter Web.
```dart
-try {
- await supabase.auth.signInWithProvider(Provider.github,
- options: const AuthOptions(
- redirectTo:
- kIsWeb ? null : 'io.supabase.flutter://reset-callback/'));
-} catch (error) {
- // handle error
-}
+await supabase.auth.signInWithProvider(Provider.github,
+ options: const AuthOptions(
+ redirectTo:
+ kIsWeb ? null : 'io.supabase.flutter://reset-callback/'));
```
### With scopes
@@ -57,13 +53,8 @@ If you need additional data from an OAuth provider, you can include a space-sepa
You may also need to specify the scopes in the provider's OAuth app settings, depending on the provider.
```dart
-try {
- await supabase.auth.signInWithProvider(Provider.github,
- options: const AuthOptions(scopes: 'repo gist notifications'));
-} catch (error) {
- // handle error
-}
-
+await supabase.auth.signInWithProvider(Provider.github,
+ options: const AuthOptions(scopes: 'repo gist notifications'));
...
// after user comes back from signin flow
diff --git a/apps/reference/_supabase_dart/generated/auth-signout.mdx b/apps/reference/_supabase_dart/generated/auth-signout.mdx
index b3ba3c9c0ba..9a85917e778 100644
--- a/apps/reference/_supabase_dart/generated/auth-signout.mdx
+++ b/apps/reference/_supabase_dart/generated/auth-signout.mdx
@@ -11,11 +11,7 @@ import TabItem from '@theme/TabItem'
Signs out the current user, if there is a logged in user.
```dart
-try {
- await supabase.auth.signOut();
-} catch (error) {
- // handle error
-}
+await supabase.auth.signOut();
```
## Examples
@@ -23,9 +19,5 @@ try {
### Sign out
```dart
-try {
- await supabase.auth.signOut();
-} catch (error) {
- // handle error
-}
+await supabase.auth.signOut();
```
diff --git a/apps/reference/_supabase_dart/generated/auth-signup.mdx b/apps/reference/_supabase_dart/generated/auth-signup.mdx
index 13b81be5c3b..68e0c2af969 100644
--- a/apps/reference/_supabase_dart/generated/auth-signup.mdx
+++ b/apps/reference/_supabase_dart/generated/auth-signup.mdx
@@ -32,13 +32,9 @@ try {
### Sign up.
```dart
-try {
- final res = await supabase.auth.signUp('[email protected]', 'example-password');
+final res = await supabase.auth.signUp('[email protected]', 'example-password');
- final user = res.user;
-} catch (error) {
- // handle error
-}
+final user = res.user;
```
### Sign up with third-party providers.
diff --git a/apps/reference/_supabase_dart/generated/auth-update.mdx b/apps/reference/_supabase_dart/generated/auth-update.mdx
index a9d0c049744..4f36026d598 100644
--- a/apps/reference/_supabase_dart/generated/auth-update.mdx
+++ b/apps/reference/_supabase_dart/generated/auth-update.mdx
@@ -28,9 +28,5 @@ Use the `update()` method if you have data which rarely changes or is specific o
### Update a user's metadata.
```dart
-try {
- final res = await supabase.auth.update(UserAttributes(data: {'hello': 'world'}));
-} catch (error) {
- // handle error
-}
+final res = await supabase.auth.update(UserAttributes(data: {'hello': 'world'}));
```
diff --git a/apps/reference/_supabase_dart/generated/containedby.mdx b/apps/reference/_supabase_dart/generated/containedby.mdx
index 7410fab9675..fb8ea8fcf7f 100644
--- a/apps/reference/_supabase_dart/generated/containedby.mdx
+++ b/apps/reference/_supabase_dart/generated/containedby.mdx
@@ -9,11 +9,10 @@ import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
```dart
-final res = await supabase
+final data = await supabase
.from('countries')
.select('name, id, main_exports')
- .containedBy('main_exports', ['cars', 'food', 'machine'])
- .execute();
+ .containedBy('main_exports', ['cars', 'food', 'machine']);
```
## Examples
@@ -21,31 +20,28 @@ final res = await supabase
### With `select()`
```dart
-final res = await supabase
+final data = await supabase
.from('countries')
.select('name, id, main_exports')
- .containedBy('main_exports', ['cars', 'food', 'machine'])
- .execute();
+ .containedBy('main_exports', ['cars', 'food', 'machine']);
```
### With `update()`
```dart
-final res = await supabase
+final data = await supabase
.from('countries')
.update({ 'name': 'Mordor' })
- .containedBy('main_exports', ['orks', 'surveillance', 'evil'])
- .execute();
+ .containedBy('main_exports', ['orks', 'surveillance', 'evil']);
```
### With `delete()`
```dart
-final res = await supabase
+final data = await supabase
.from('countries')
.delete()
- .containedBy('main_exports', ['cars', 'food', 'machine'])
- .execute();
+ .containedBy('main_exports', ['cars', 'food', 'machine']);
```
### With `rpc()`