Open diegonc opened 1 year ago
There also seems to be a mismatch between the expected query parameter name (refresh_token
) and the actual parameter name used by NHost callback (refreshToken
)
EDIT: here is a workaround for now
if (uri.queryParameters.containsKey('refreshToken')) {
Map<String, String> params = {};
params.addAll(uri.queryParameters);
params['refresh_token'] = uri.queryParameters['refreshToken']!;
client.auth
.completeOAuthProviderSignIn(uri.replace(queryParameters: params));
} else {
client.auth.completeOAuthProviderSignIn(uri);
}
Hi, I have updated all examples ready on this PR https://github.com/nhost/nhost-dart/pull/95
We are activity working to improve the SDK. stay tuned.
Hi, thank you very much for your work!
Will this improvements include the migration from the old backend URL discussed in the link below?
Yes, I am working on it. I think we will make it in the next major release two.
@diegonc Check this out nhost_sdk: ^4.0.0-dev.8
or this link for supporting subdomain and region.
Unfortunately, using launchUrl
with Facebook would block me from authenticating because of Embedded browser security check from Facebook.
Found a workaround to authenticate with OAuth in Flutter though.
initialUrl
with '${createNhostServiceEndpoint(subdomain: YOUR_SUBDOMAIN, region: YOUR_REGION, service: 'auth')}/signin/provider/facebook'redirectUrls
with your callback URL (https://xxxxxx.auth.YOUR_REGION.nhost.run/v1/signin/provider/facebook/callback)After successful auth, should return with the callback?code=
The example now has updated URLs but still doesn't work because it refers to success/failure callback settings, which do not seem to be supported. Is there an updated suggestion for how to implement?
because it refers to success/failure callback settings
that part is incorrect, there is no success/failure URLs in hasura-auth, instead, if there is an error, the callback url will include an error query arg describing the issue
The example's comments give wrong instructions regarding the configuration of NHost's OAuth callbacks:
At line 10 it reads:
wheareas only one callback URL can be set on GitHub settings and no URL can be set on NHost's GitHub provider configuration.
Also at line 23, the sign in URL is wrong. It should look like: