firebase / FirebaseUI-Flutter

Apache License 2.0
101 stars 91 forks source link

[flutterfire_ui] add support for email link sign in on web #61

Open lesnitsky opened 2 years ago

lesnitsky commented 2 years ago

Any plans to expand email link sign-in to web (currently only iOS and Android)?

Originally posted by @wolframm in https://github.com/FirebaseExtended/flutterfire/discussions/6978#discussioncomment-1804939

jbryanh commented 2 years ago

Excited to see this getting close to fruition. Have an app that does not use passwords, and I need to create a web app, so this would be nice. I assume it means that dynamic_links is close to being available for web. How soon? Happy to help test or whatever.

lesnitsky commented 2 years ago

I think the way this could be handled is via flutter's routing mechanism. This would only work on a hosted flutter web app.

Example scenario:

Adding these to the flutterfire_ui directly would require less effort, rather than making dynamic_links work on the web, but the latter is also doable (at least in my head)

ywake commented 5 months ago

I hope for web support.

By the way, to support web, two things are necessary: the redirect URL inside DynamicLink and the entered email address. The URL can be obtained with GoRouter or similar, and for retrieving the entered email address, I've added a callback to EmailLinkSignInScreen.

I consider this a temporary solution, so I haven't created a pull request for it, but please refer to it if you're looking for a simple implementation.

https://github.com/ywake/FirebaseUI-Flutter/tree/email-link-web diff

More details are in Japanese here.