From d7ed4b0eddf2fa133b3fa8158c54db582a92a44b Mon Sep 17 00:00:00 2001
From: dshukertjr <18113850+dshukertjr@users.noreply.github.com>
Date: Sat, 22 Oct 2022 10:33:41 +0900
Subject: [PATCH] Adds notes on deprecated auth class on flutter v1 migration
guide
---
.../_supabase_dart/upgrade-guide.mdx | 46 ++++++++++++++++++-
1 file changed, 44 insertions(+), 2 deletions(-)
diff --git a/apps/reference/_supabase_dart/upgrade-guide.mdx b/apps/reference/_supabase_dart/upgrade-guide.mdx
index da6a3e6188d..6308172b836 100644
--- a/apps/reference/_supabase_dart/upgrade-guide.mdx
+++ b/apps/reference/_supabase_dart/upgrade-guide.mdx
@@ -54,10 +54,50 @@ try {
+## Auth classes / methods
-## Auth methods
+### Usage of `AuthState` and `AuthRequiredState` classes
-The signIn() method has been deprecated in favor of more explicit method signatures to help with type hinting. Previously it was difficult for developers to know what they were missing (e.g., a lot of developers didn't realize they could use passwordless magic links).
+In v0, `AuthState` and `AuthRequiredState` were required to handle automatic token refresh and to listen to auth state change. In v1, `AuthState` and `AuthRequiredState` are deprecated, and token refresh will happen automatically just by initializing Supabase. [`onAuthStateChange`](/docs/reference/dart/upgrade-guide#listening-to-auth-state-change) can be used to action on auth state change.
+
+
+
+
+
+```dart
+await Supabase.initialize(
+ url: 'SUPABASE_URL',
+ anonKey: 'SUPABASE_ANON_KEY',
+);
+...
+
+class AuthState extends SupabaseAuthState {
+ ...
+}
+
+...
+
+class AuthRequiredState extends SupabaseAuthState {
+ ...
+}
+```
+
+
+
+
+```dart
+await Supabase.initialize(
+ url: 'SUPABASE_URL',
+ anonKey: 'SUPABASE_ANON_KEY',
+);
+```
+
+
### Listening to auth state change
@@ -99,6 +139,8 @@ authSubscription.cancel();
### Sign in with email and password
+The signIn() method has been deprecated in favor of more explicit method signatures to help with type hinting. Previously it was difficult for developers to know what they were missing (e.g., a lot of developers didn't realize they could use passwordless magic links).
+