Code Monkey home page Code Monkey logo

flutter-auth-ui's Introduction

flutter-auth-ui 📱

A simple library of predefined widgets to easily and quickly create auth components using Flutter and Supabase.

Supabase Auth UI

Email Auth

Use a SupaEmailAuth widget to create an email and password signin/ signup form. It also contains a button to toggle to display a forgot password form.

You can pass metadataFields to add additional fields to the signup form to pass as metadata to Supabase.

You need to setup deep links in your app to if you have enabled email confirmation. Learn more about deep links on the supabase_flutter README.

// Create a Email sign-in/sign-up form
SupaEmailAuth(
  redirectTo: kIsWeb ? null : 'io.mydomain.myapp://callback',
  onSignInComplete: (response) {
    // do something, for example: navigate('home');
  },
  onSignUpComplete: (response) {
    // do something, for example: navigate("wait_for_email");
  },
  metadataFields: [
    MetaDataField(
      prefixIcon: const Icon(Icons.person),
      label: 'Username',
      key: 'username',
      validator: (val) {
        if (val == null || val.isEmpty) {
          return 'Please enter something';
        }
        return null;
      },
    ),
  ],
),

Magic Link Auth

Use SupaMagicAuth widget to create a magic link signIn form. You need to setup deep links in your app to use magic link. Learn more about deep links on the supabase_flutter README.

SupaMagicAuth(
  redirectUrl: kIsWeb ? null : 'io.supabase.flutter://reset-callback/',
  onSuccess: (Session response) {
    // do something, for example: navigate('home');
  },
  onError: (error) {
    // do something, for example: navigate("wait_for_email");
  },
),

Reset password

Use SupaResetPassword to create a password reset form.

SupaResetPassword(
  accessToken: supabase.auth.currentSession?.accessToken,
  onSuccess: (UserResponse response) {
    // do something, for example: navigate('home');
  },
  onError: (error) {
    // do something, for example: navigate("wait_for_email");
  },
),

Social Auth

Use SupaSocialsAuth to create list of social login buttons. You need to setup deep links in your app to use social auth. Learn more about deep links on the supabase_flutter README.

SupaSocialsAuth(
    socialProviders: [
        OAuthProvider.apple,
        OAuthProvider.google,
    ],
    colored: true,
    redirectUrl: kIsWeb
          ? null
          : 'io.supabase.flutter://reset-callback/',
    onSuccess: (Session response) {
        // do something, for example: navigate('home');
    },
    onError: (error) {
        // do something, for example: navigate("wait_for_email");
    },
),

Theming

This library uses bare Flutter components so that you can control the appearance of the components using your own theme.

flutter-auth-ui's People

Contributors

bcihanc avatar brericha avatar csierram96 avatar dannypurcell avatar dippa-1 avatar dshukertjr avatar fatumaa avatar geoextra avatar getkey avatar hankg avatar henry2man avatar htsuruo avatar javascriptmick avatar kosukesaigusa avatar lohysor avatar pohuing avatar tomasalabes avatar willibobadilla avatar wtosborne avatar yakubsubasi avatar zeyrin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flutter-auth-ui's Issues

Dependency version solving failed

Bug report

Describe the bug

When I want to add supabase_auth_ui v0.4.0+1 to my flutter project, I always get a dependency version solving failed when I run flutter pub get. Here is my Flutter and dart version:

Flutter 3.16.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 78666c8dc5 (3 weeks ago) • 2023-12-19 16:14:14 -0800
Engine • revision 3f3e560236
Tools • Dart 3.2.3 • DevTools 2.28.4

To Reproduce

Steps to reproduce the behavior:

  1. Create a new flutter project
  2. Add these dependencies
 cupertino_icons: ^1.0.2
  supabase_flutter: ^2.1.0
  flutter_dotenv: ^5.1.0
  gap: ^3.0.1
  slideable: ^0.0.2
  google_fonts: ^6.1.0
  flutter_svg: ^2.0.9
  flutter_signin_button: ^2.0.0
  banner_carousel: ^1.2.1
  multi_dropdown: ^2.1.3
  chips_choice: ^3.0.1
  font_awesome_flutter: ^9.2.0
  matcher: ^0.12.16
  material_color_utilities: ^0.5.0
  meta: ^1.10.0
  path: ^1.8.3
  test_api: ^0.6.1
  web: ^0.3.0
  web_socket_channel: ^2.4.0
  supabase_auth_ui: ^0.4.0+1
  1. Run flutter pub get

Expected behavior

I expect the behavior successfully added the supabase_auth_ui package to my project.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS Sonoma v14.2.1
  • Flutter: 3.16.5 channel stable
  • Dart: 3.2.3

Additional context

Command output from flutter pub get

Because supabase_auth_ui >=0.4.0 depends on font_awesome_flutter ^10.6.0 and sushi_app depends on font_awesome_flutter ^9.2.0,
  supabase_auth_ui >=0.4.0 is forbidden.
So, because sushi_app depends on supabase_auth_ui ^0.4.0+1, version solving failed.

Google auth button: google image has white background, and looks bad if the theme color for the button is not white

Bug report

Describe the bug

Google auth button: google image has white background, and looks bad if the theme color for the button is not white

To Reproduce

Change the ElevatedButton backgroung in theme of the app to something else than white.

Expected behavior

The image should be a png or vector without background color so it looks ok on buttons with different backgrounds

Screenshots

Screenshot 2023-02-23 at 8 31 58 AM
Screenshot 2023-02-23 at 8 31 46 AM

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of supabase-js: [e.g. 6.0.2]
  • Version of Node.js: [e.g. 10.10.0]

Additional context

Add any other context about the problem here.

Support supabase_flutter Version 2.* (version solving failed)

Feature request

Any plan to update this lib to support 2.* version of supabase flutter lib? (supabase_flutter: ^2.0.1)

Is your feature request related to a problem? Please describe.

Unable to install with new Supabase Flutter version...

dart pub add supabase_auth_ui
Because supabase_auth_ui <0.0.1-dev.2 depends on supabase_flutter ^1.0.0-dev.1 and supabase_auth_ui >=0.0.1-dev.2 <0.0.1-dev.3 depends on
  supabase_flutter ^1.0.0-dev.3, supabase_auth_ui <0.0.1-dev.3 requires supabase_flutter ^1.0.0-dev.1.
And because supabase_auth_ui >=0.0.1-dev.3 <0.0.1 depends on supabase_flutter ^1.0.0-dev.9, supabase_auth_ui <=0.0.1-dev.4 requires
  supabase_flutter ^1.0.0-dev.1.
And because supabase_auth_ui ^0.0.1 depends on supabase_flutter ^1.0.0 and supabase_auth_ui >=0.1.0 depends on supabase_flutter ^1.4.0,
  every version of supabase_auth_ui requires supabase_flutter ^1.0.0-dev.1.
So, because trolleymate_app depends on both supabase_flutter ^2.0.1 and supabase_auth_ui any, version solving failed.

Describe the solution you'd like

Update dependencies so it can be installed with the new version of flutter_supabase

Details of the update here (can't seen any breaking changes)... https://supabase.com/blog/client-libraries-v2

Describe alternatives you've considered

Looked briefly at supaauth but it also doesn't support 2
Also considered skipping and building my own UI but I really think this lib is useful and would prefer to use it.

Redirect url and browser window

SupaSocialsAuth(
socialProviders: [
SocialProviders.google,
SocialProviders.facebook,
etc...
Does't close a browser window
Which redirect link is correct?
You mentioned 3 different approach in the documentation
-io.supabase.flutterquickstart://login-callback/ ?
-io.supabase.flutter://reset-callback/
-https://***.supabase.co/auth/v1/callback
SCR-20230609-o01

If signed in with Google provider, signOut does not sign out of the provider

Bug report

Describe the bug

When signed in with Google as the provider on an Android device, signOut() ends the Supabase session but does not log out from the provider as well.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

Sign in setup

SupaSocialsAuth(
	socialProviders: const [OAuthProvider.google],
	nativeGoogleAuthConfig: const NativeGoogleAuthConfig(webClientId: '...'),
	onSuccess: (Session session) {},
)

Sign out action
Supabase.instance.client.auth.signOut()

  1. On first sign-in on an Android device, an account chooser is displayed
  2. Select an account from the list and login
  3. Sign out and return to the login screen
  4. Sign in again. This time the login completes without presenting the account chooser

Expected behavior

On sign-in after a sign-out, the account chooser should be displayed again.

System information

  • OS: Android 14
  • supabase_auth_ui: 0.4.3

WASM build support

Bug report

Describe the bug

A project cannot be compiled using flutter build web --wasm since the transitive dependency sign_in_with_apple_web doesn't support the new js interop bindings. This is caused by an outdated dependency version of sign_in_with_apple and is fixed with the latest version.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Upgrade to Flutter 3.22.0
  2. Install supabase_auth_ui dependency
  3. Build with flutter build web --wasm

Example error message:

[...]/Cache/hosted/pub.dev/sign_in_with_apple_web-1.0.1/lib/sign_in_with_apple_web.dart:8:1: 
Error: JS interop library 'package:js/js_util.dart' can't be imported when compiling to Wasm.
Try using 'dart:js_interop' or 'dart:js_interop_unsafe' instead.
import 'package:js/js_util.dart';

Expected behavior

Compilation should be possible with upgraded dependencies. Unfortunatly, I cannot test this.

How to use Native Apple login on iOS

Feature request

How to use Native Apple login on iOS using the flutter-auth-ui package

Is your feature request related to a problem? Please describe.

A clear and concise description of what you want and what your use case is.

Describe the solution you'd like

A clear and concise description of what you want to happen.

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

Instant sign in when password reset

Bug report

Describe the bug

In the example given clicking on password reset and entering an existing email, one is instantly logged in without having to click on the link in the email or entering any password.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Click on 'Forgot Password? Click here'
  2. Type in email of existing account
  3. Click on 'Send Reset Email'
    => One is logged in instantly

Expected behavior

  1. Click on 'Forgot Password? Click here'
  2. Type in an existing email
  3. Click on 'Send Reset Email'
  4. Click on Link in Reset Email
  5. Get redirected to Password Reset screen
  6. Get signed in or get redirected to sign in screen to type in new password

Feature request to be able to override some methods/features

Hi,

I just wanted to say thanks for a great package we can use to simplify authentication with. It really does make it go faster and I know I have qualified devs working on auth for/with me. Sometimes it's not an easy thing, especially when I'm new to flutter.

So my request is for the ability to override, or allow us more options/customization of SupabaseAuth. Couple things come to mind when I say this. 1. I was working through the chat app tutorial, the branch with auth, and when a user is added to the table, a trigger then adds a couple fields into the profile table. One of the things that's supposed to be added to profile's page is the username from auth.users. Well the username now comes from the raw_user_meta_data jsonb column. So the email and pass get's inserted, but no username. And there is no way to add the username to the metadata column in flutter with this package. I ended up just creating another trigger and function that add's a new username into metadata column when inserting and then taking that and inserting into the username column in the profiles page.

Here's the code to do this if anyone would be interested and came across the same issue as me. Took me a little bit to figure out how to handle the jsonb in a trigger/function like this, but did finally get it working. So the email is just used for the username as well. This function add's it into the same table but in the metadata column, and then the trigger/function from the tutorial picks that up and inserts it into the profile table along with other info.

create
or replace function handle_new_user_metadata() returns trigger as $$
    begin
          update auth.users
          set raw_user_meta_data['username'] = to_jsonb(auth.users.email)
          WHERE auth.users.id = NEW.id;
        return NEW;
    end;
$$ language plpgsql security definer;

DROP TRIGGER
  IF EXISTS on_auth_user_created_meta ON auth.users CASCADE;

create trigger
  on_auth_user_created_meta
after
insert
  on auth.users for each row
execute
  function handle_new_user_metadata();

It would be a lot easier though if we were able to do this from dart/flutter. I see there is already the capability in the supabase client, but we can't access it from this package. Only the email and pass can be used when calling to create a user in registration. So that would be nice to override/ or just have all 4 of the parameters that are in the supabase sdk create user method.

Second would be the navigation. I'm using riverpod and go router for my nav. Riverpod listens for auth state changes, then go router listens to riverpod to trigger it to log the user in/out according to their auth state. But then when there is code for a second navigation, it messes with the whole flow. Maybe an option to use your own router and logic, or use what's baked in?

These are just some suggestions. I love the idea of being able to quickly get auth going so I can get on with the actual business logic a client needs. You have done a wonderful job on that and just wanted to say I appreciate it a lot.

Can't get session and user after success call supabase.auth.signInWithOAuth(Provider.******)

Can't get session and user after success call supabase.auth.signInWithOAuth(Provider.******)

After signing into the app with supabase.auth.signInWithOAuth(Provider.******);
it is clear that everything worked correctly, the user's photo appears in the window.
But I can't get session and user: Supabase.instance.client.auth.currentSession == null
and Supabase.instance.client.auth.currentUser == null.
In the supabase console, the new user is not added to the user list.

Prompt the decision of reception of session and the user after OAUTH authorization.

Add authScreenLaunchMode

Feature request:

Add authScreenLaunchMode to https://pub.dev/packages/supabase_auth_ui package

Is your feature request related to a problem? Please describe.

Yes. Current experience when using social logins for Google, Facebook, and Apple is an internal browser to login and then to display redirect. However, the onSuccess function and session data is not provided until the user redirects back to the app. With the current experience users have to pull up on the internal browser before they can see the iOS redirect link (assume similar experience with Android) which triggers onSuccess and session data to be sent to app. However, the user then also needs to click done to finish and be navigated to the post login app page.

This requires high cognitive load on users to understand they need to pull down on internal browser, click redirect link which is not intuitive because they are already in the app, and then click done to finish logging in.

Instead if authScreenLaunchMode option was available I could assign LaunchMode.externalApplication and the redirect would automatically prompt user to return to app after logging in. Have tested and this solves the issue above.

A clear and concise description of what you want and what your use case is.

Describe the solution you'd like

Add authScreenLaunchMode as a parameter to SupaSocialsAuth Widget and allow user to assign LaunchMode.externalApplication type.

A clear and concise description of what you want to happen.

Describe alternatives you've considered

Manually create own socials login UI and use supabase.auth.signInWithOauth which has authScreenLaunchMode: LaunchMode.externalApplication capability.

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

AuthRetryableFetchException (AuthException(message: AuthRetryableFetchError, statusCode: null))

Bug report

Describe the bug

I am trying to use the email as an authentication tool and based on this repo. But I keep getting the error "Exception has occurred. AuthRetryableFetchException (AuthException(message: AuthRetryableFetchError, statusCode: null))" and I could not figure out why for a few days. Before this, using Google email as a sign-up option works fine on my project. Moreover, every time I launch my project/do sign-up authentication, I can see the number of requests increase on DataBase and Auth modules on the Supabase website. Now I am confused what happened.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. download this repo,
  2. open on Visual Studio,
  3. replace Superbase_url and Superbase_anonKey with my project identification.
  4. do email sign-up

Expected behavior

able to sign-up by using email address

Screenshots

截屏2024-04-18 15 31 41 截屏2024-04-18 15 33 35

System information

  • OS: macOS
  • Version of supabase-js: latest

password confirmation and error messages

I've used it and like it however, it'd be great if I can add password confirmation for sign up and customizable error messages.
I've tried my best but failed to add them using this plugin.

Cheers!

Additions to Improve Library..

I've taken a look at this library and played with it a bit.. Here are a few suggestions to improve it..

  1. Show user how to query Supabase after login.. I don't understand how I'm to use the authenticated user from this package in a Supabase request.. When using the base supabase_flutter library, I got caught out intializing two Supabase instances which made all my calls fail when RLS was implemented.
  2. Show the deep linking in action, actually working and how to set it up.. This is something I'm still trying to understand..
  3. Show Logout Flow.. I logged in using this package, but there was no logout button.
  4. Show restored session flow.
  5. Show how the new 1.0.0-dev OnAuthenticated/UnAuthenticated State from Supabase package should be used..

This is a great package and it helped me solve one flow problem.. Thanks.

FR: Override social provider names in SupaSocialsAuth ("Azure" --> "Microsoft (Azure)" for example)

Feature request

Is your feature request related to a problem? Please describe.

I want to customize the shown names in SupaSocialsAuth widget. Precisely, I want to change the label "Azure" with "Microsoft (Azure)". Why? Simple: Normal people won't correlate Azure with Microsoft as developers does.

Describe the solution you'd like

Have extra localization attributes in SupaSocialsAuthLocalization for provider names

Describe alternatives you've considered

N/A

Additional context

N/A

How to implement persistent email / password field between signup/signin/magiclink/resetpassword

Hi,

if the feature make sense for the library, do you have an idea of how we could provide persistence between screens?

Probably we should support two use cases:

  • persistently store the email to reuse at next sign in
  • temporarily store email / password between the relevant screens

Which screen should support that? ie does it make sense for reset password?

Passing a default initialEmail/initialPassword is a bit annoying, cause with go_router when changing screens the supabase components may not change instance and those not use the new initialEmail/initialPassword

Implement authAction on SupaEmailAuth

Feature request

Expose callback and state injection into SupaEmailAuth similar to PhoneSignUp and PhoneSignIn.

Currently, SupaEmailAuth does not implement a way to expose the current internal state to other widgets (parents/siblings). A simple yet compelling reason to implement this is to allow for dynamically changing the AppBar label of the example page from "Sign In" to "Sign Up" when the SupaAuthAction changes from "signIn" to "signUp":

... @override Widget build(BuildContext context) { return Scaffold( appBar: appBar(title: Text(isSigningIn ? 'Sign In' : 'Sign Up')) ...

This also allows splitting Sign In and Sign Up into two pages for finer grained control over the auth/account creation flow. This is already implemented in PhoneSignUp and PhoneSignIn.

Describe alternatives you've considered

Other than forking the repo and implementing it myself, there isn't an external workaround I see here as _isSigningIn is an internal variable to the SupaEmailAuth state.

Happy to discuss and refine the request if there is anything in need of clarification.

Apple auth button text is not visible

Bug report

Describe the bug

Apple auth button text is not visible

To Reproduce

Change the onBackground theme color to a color that doesnt have enough contrast on black.
I' currentl using flexCOlorScheme package without any additional config, and I'm not able to see the button text.

Expected behavior

See the buttons text

Screenshots

Screenshot 2023-02-23 at 8 31 58 AM
Screenshot 2023-02-23 at 8 31 46 AM

System information

  • OS: [e.g. macOS, Windows]
  • Browser (if applies) [e.g. chrome, safari]
  • Version of supabase-js: [e.g. 6.0.2]
  • Version of Node.js: [e.g. 10.10.0]

Additional context

Add any other context about the problem here.

Add native Apple and Google sign in for iOS and Android

Feature request

Is your feature request related to a problem? Please describe.

Currently this package only support OAuth sign in via signInWithOAuth(). This opens up the web view, which is not ideal for native apps. Supabase currently supports native sign in for Google and Apple login, so it would be great if we can support them in this package.

Describe the solution you'd like

Add an easy way to implement Apple and Google native sign in.

Describe alternatives you've considered

Create an parameter on SupaSocialsAuth class that accepts Widget so that users can pass their own widget to be displayed. This would allow the users to add Native sign in button, but does not bring the convenience.

Add docs for this under auth helpers?

ReadMe should show how to initialise the project when using this library.
You don't need the supabase_flutter dependency directly if only using the auth ui lib

Using MetadataField for boolean values

Feature request

I'd like to add some checkboxes on new user signup for consenting to terms of service and opt-in to marketing emails. I'd like this to be integrated into the auth ui.

Is your feature request related to a problem? Please describe.

MetadataField assumes the only values we want from users on signup are text, like username. I looked at extrametadata but (forgive me if I'm wrong) that doesn't seem to allow the user to edit values.

Describe the solution you'd like

Potentially a different class, e.g. BooleanMetadataField, with a checkbox widget, or perhaps a new property on MetadataField to specify what kind of metadata to solicit from the user

Describe alternatives you've considered

Apologies if there's some obvious solution here that I'm missing. This is my first time working on auth so I'm a bit unfamiliar with what the best practices are (which is why I'm using this package rather than trying to roll my own auth form).

Update Phone Auth Flow

Chore

Updating the phone auth to work more smoothly and similar to the email/password flow.

Add TextInputActions to email and phone sign-in forms

Feature request

Is your feature request related to a problem? Please describe.

Both the email as well as the phone number form fields hint are missing TextInputAction hints. These cause phone keyboards to always show a "done" action, requiring a tap into the next field

The current behaviour, note the "enter" button on the bottom right
missing.webm

Describe the solution you'd like

Instead the keyboard should show a "next" action which on tap selects the next field in the Form.

Additional context

This is pretty clear, both Android and iOS support these in lieu of tab navigation.

The proposed behaviour, note the right arrow in place of the enter.
with.actions.webm

Incomplete "Forgot your password" feature

Bug report

Describe the bug

When you try to reset the password the form is unreactive. If you go back to the sign in page, the sign in button is locked and "spinning"

To Reproduce

Just setup Supabase as per docs:

await Supabase.initialize(
    url: <URL>,
    anonKey: <AnonKey>,
  );

and place in your app a simple auth widget:

SupaEmailAuth(
    onSignInComplete: (response) {
      // do something, for example: navigate('home');
    },
    onSignUpComplete: (response) {
      // do something, for example: navigate("wait_for_email");
    },
  ),

and make sure that a user exists in the database.

Then:

  1. Display the widget
  2. Click on 'Forgot your password?'
  3. Write the user email
  4. Click on 'Send password reset email'
  5. Visually nothing happens (command is sent under the hoods)
  6. Click on 'Back to sign in'
  7. The sign in button is disabled an shows an spinner

Expected behavior

The password reset command is sent, an snackbar is shown and the widget displays the Sign In form again.

Screenshots

Captura de pantalla 2024-04-18 a las 11 19 29

System information

  • OS: macOS Sonoma
  • Platform: macOS / Web+Chrome
  • supabase_flutter: ^2.5.1
  • supabase_auth_ui: ^0.4.4

Additional context

Maybe related with #36 ?

Better example of deep link

Improve documentation

Link

Add a link to the page which needs improvement (if relevant)

The whole deep link to app is very, very confusing to me... I don't know what a "redirect_url" to an Android or iOS app would be to configure "redirect url". The use of site_url is clear enough but what if I want the user to come back to the mobile app after signup and email confirmation? See: https://github.com/orgs/supabase/discussions/5947#discussioncomment-6158307

Is the documentation missing? Or is it confusing? Why is it confusing?

Show me a proper sequence diagram; show me step by step examples. Tell me why should I add localhost:3000 in site_url but io.supabase.flutterquickstart://login-callback - where did the io.supabase.flutterquickstart come from? Is the the name of the flutter project? Is it the name of the Supabase project? what is login-callback? Is it a page? Or is it a route in flutter?

I've suggested a sequence diagram - it would convey a whole lot.

If there is additional context that's necessary - e.g., "You'll need to learn Android deep links and how they work - go here" etc. - would take a huge amount of guess work.

PLEASE

Additional context

Add any other context or screenshots that help clarify your question.

Resume on App Startup

Under the pre-1.0 API resume on app launch happened by calling into the SupabaseAuthState.recoverSupabaseSession(). A version of that method still exists on SupabaseAuth but it is now private and only accessed through SupabaseAuth.didChangeAppLifecycleState with a "resumed" AppLifecycleState value. I can't see where that is being called. In the Supabase Auth UI project I created a method which calls SupabaseAuth.instance.didChangeAppLifecycleState(AppLifecycleState.resumed). I can get it to resume the session but there are a couple of problems. First, the _recoverSupabaseSession() is async but didChangeAppLifecycleState is not so there is no way to await for the return or to know what the return value was. Second, it feels like this is supposed to be initiated somewhere else but I can't determine where. My workaround right now is to call this right after init, add a button to a splash screen to go into the real part of the app, and then only click that button once I see that the session has been restored in the output. That is all obviously not ideal.

Is there a plan to have this reload exposed elsewhere in a way we can wait for it at our app level or expose the recover method itself for direct initiation?

`onSuccess` not called in `SupaSocialsAuth`

Bug report

Describe the bug

onSuccess not called in SupaSocialsAuth

Accoding to the readme https://github.com/supabase-community/flutter-auth-ui#social-auth
this was intended to work as the other auth flows do.

To Reproduce

  • Set a function to SupaSocialsAuth(onSuccess)
  • Set a breakpoint or print something in the function body.
  • Run login flow
  • Breakpoint/print is never triggered.

Expected behavior

onSuccess should be called in the case of SupaSocialsAuth as it is with the other auth flows.

Additional context

This appears to be due to signInWithOAuth being implemented as an extension to GoTrueClient and therefore not being able to call notifyAllSubscribers. The pkce flow to the external provider is also kind of opaque from the perspective of signInWithOAuth, we're just launching the url so there's not a great way to know for sure that it succeeded from that point in the code.

The email sign in autocomplete is not applied to the entire form

Bug report

Describe the bug

SupaEmailAuth only prompts for autofill on the password field

To Reproduce

Use SupaEmailAuth, tap into the email field.

Expected behavior

The app should propt the keyboard for autofill credentials and subsequently show the user configured autofill flow.

System information

Android 14
supabase_auth_ui: ^0.4.3
Flutter: Channel stable, 3.19.3

Additional context

The problem arises because SupaEmailAuth does not wrap the Form in an AutofillGroup.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.