Open subhendukundu opened 3 years ago
There is an example here for logging in via GitHub. The other providers should be similar.
Does that help?
It does definitely help. But I think it's just easier for developers, easy with sample code. Sometimes they can just stuck with small things. Plus I think we should just focus on "making product as easy as possible". So they can just focus on product. We can take care of the rest. Just a thought, you don't have to take this too seriously. 🙂
PS: I can help.
No, it's a great suggestion, and I agree the process should be easier.
One of the tricky parts about the social logins is that you need to tweak the configuration of the native app so that it recognizes a custom app URI (which calls back into the app from the browser). So it's not quite as copy-pasteable as other examples, even if all the Dart code is right in front of you. Then there's also the backend config, and having to set that up properly.
Maybe the ideal would be to add some capability to nhost_flutter_auth
, or a new package (one that includes the necessary plugins)? An API where you could say nhost.auth.loginWithGitHub()
, and have it return a Future
that resolves just like any other login call.
It could even check your configuration (native app, and backend). Complain if it finds problems. Link you to resources that might help.
What do you think?
So We can keep 2 packages. One is the core. Few devs might not want to add these but we will still add these dependencies, which is not good I think. The other package/packages, which will have all the native, and devs just plug it in and use it. Might be okay adding easy config in native if really needed to.
@elitan and I keen to make developer experiences as easy we can. Just like no-code but legos.
@elitan and I keen to make developer experiences as easy we can. Just like no-code but legos.
Makes sense. I think we can get something like that going.
Sorry, to be clear, that seems like a good goal, and is certainly possible. Whether to pursue is not my call.
Well I had been playing around with nhost-dart for a while now. Few observations.
So this is what I did.
flutter_web_auth
.
Setting the callback urls to 'io.higgle.dakuapp://login-callback
Future googleSignIn() async {
try {
final result = await FlutterWebAuth.authenticate(
url: nhostGoogleLoginUrl,
callbackUrlScheme: 'io.higgle.dakuapp://login-callback',
);
nhostClient.auth.completeOAuthProviderLogin(Uri.parse(result));
return true;
} catch (e) {
print(e);
return false;
}
}
And this works. But what about the web support? https://daku.app has web support. Any idea?
I think it would be beneficial if we add different examples for all the possible logins. Clear and easy to understand.