-
-
Notifications
You must be signed in to change notification settings - Fork 208
feat: Add third-party auth support #999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
fb5074a
709f8ce
164af6b
343c5e6
b0d8162
43a115b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,6 +75,7 @@ class Supabase { | |
PostgrestClientOptions postgrestOptions = const PostgrestClientOptions(), | ||
StorageClientOptions storageOptions = const StorageClientOptions(), | ||
FlutterAuthClientOptions authOptions = const FlutterAuthClientOptions(), | ||
Future<String> Function()? accessToken, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe create a typedef for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for the feedback! I know this is highly opinionated, but I really feel that using typedef generally decreases the readability of the code. Especially since a property named |
||
bool? debug, | ||
}) async { | ||
assert( | ||
|
@@ -103,6 +104,7 @@ class Supabase { | |
authOptions: authOptions, | ||
postgrestOptions: postgrestOptions, | ||
storageOptions: storageOptions, | ||
accessToken: accessToken, | ||
); | ||
_instance._debugEnable = debug ?? kDebugMode; | ||
_instance.log('***** Supabase init completed $_instance'); | ||
|
@@ -154,6 +156,7 @@ class Supabase { | |
required PostgrestClientOptions postgrestOptions, | ||
required StorageClientOptions storageOptions, | ||
required AuthClientOptions authOptions, | ||
required Future<String> Function()? accessToken, | ||
}) { | ||
final headers = { | ||
...Constants.defaultHeaders, | ||
|
@@ -168,6 +171,7 @@ class Supabase { | |
postgrestOptions: postgrestOptions, | ||
storageOptions: storageOptions, | ||
authOptions: authOptions, | ||
accessToken: accessToken, | ||
); | ||
_initialized = true; | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a custom access token is passed, no auth instance should be created, right? From what I see, this is still the case, but just because it's marked as
late
. I would prefer a clearer structure to ensure no auth instance is created.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can always come back and change the implementation of it. For now, I'm going to merge this PR as this is not really critical.