nhost-dart icon indicating copy to clipboard operation
nhost-dart copied to clipboard

Add support for Nhost v2

Open shyndman opened this issue 3 years ago • 12 comments

Beta is out the door. Work remaining:

  • [ ] Evaluate the need for _loading in AuthService
  • [x] Add missing sign in methods
  • [ ] Review backend endpoint by endpoint, ensuring we have support
    • [x] Resend e-mail verification process/e-mail

shyndman avatar Jan 27 '22 01:01 shyndman

Not quite ready to close yet.

shyndman avatar Jan 28 '22 23:01 shyndman

Just published #50 to pub. Here are the new versions:

nhost_sdk                3.0.0-beta.0
nhost_gql_links          2.0.0-beta.0
nhost_flutter_auth       2.0.0-beta.0
nhost_graphql_adapter    2.0.0-beta.0
nhost_flutter_graphql    2.0.0-beta.0

This is still a work in progress, but I'm going to be knocking off what's missing over the coming days, and continue to cut beta releases as I do so.

shyndman avatar Jan 28 '22 23:01 shyndman

New set of packages out the door, including the changes in #57 and #58.

nhost_sdk                3.0.0-beta.1
nhost_gql_links          2.0.0-beta.1
nhost_flutter_auth       2.0.0-beta.1
nhost_graphql_adapter    2.0.0-beta.1
nhost_flutter_graphql    2.0.0-beta.1

shyndman avatar Feb 01 '22 09:02 shyndman

Hi @shyndman, Johan said that V2 will offer an endpoint to retrieve the e-mail verification process/e-mail, is that already covered within the new sdk as method? Thanks!

MaxSchilling avatar Feb 15 '22 14:02 MaxSchilling

Hey @MaxSchilling,

It is not. Let me take a look at getting this in.

shyndman avatar Feb 21 '22 20:02 shyndman

To be clear, you're looking to retrieve the text of the verification email?

shyndman avatar Feb 21 '22 20:02 shyndman

If you're looking for the ticket used to verify the email address, it's stored in the auth.users table, and can be accessed via gql. Keep in mind that the permissions will have to be set up appropriately to modify view/modify the value.

shyndman avatar Feb 21 '22 20:02 shyndman

Hey Scott, no actually a method to re-trigger the actual email-verification mail from the server, as the account activation ticket (that is created on registration) expires after 60 minutes. As I understood Johan in V2 there is a way/endpoint to retrigger the token and trigger the activation mail for the user again. This wasn't possible in v1 and we lost quite some users through missing that functionality / not activating within 60 minuted.

So would be great to provide that functionality.

Bonus would be if the authenticationState could reflect wether the user activated the account yet, would make the routing easier to route to a re-send verification screen / functionality.

MaxSchilling avatar Feb 21 '22 20:02 MaxSchilling

Got it.

@elitan, which endpoint is @MaxSchilling referring to?

shyndman avatar Feb 21 '22 21:02 shyndman

@shyndman This one: https://github.com/nhost/nhost/blob/main/packages/hasura-auth-js/src/hasura-auth-api.ts#L149

elitan avatar Feb 22 '22 06:02 elitan

Thanks! Got that in.

I'm publishing a new set of packages now. Here are the versions:

nhost_sdk                3.0.0-beta.3
nhost_flutter_auth       2.0.0-beta.3
nhost_gql_links          2.0.0-beta.3
nhost_graphql_adapter    2.0.0-beta.3
nhost_flutter_graphql    2.0.0-beta.3

shyndman avatar Feb 23 '22 21:02 shyndman

Packages are now graduated to stable:

nhost_sdk                3.0.0
nhost_gql_links          2.0.0
nhost_graphql_adapter    2.0.0
nhost_flutter_auth       2.0.0
nhost_flutter_graphql    2.0.0

shyndman avatar Mar 11 '22 05:03 shyndman

Evaluate the need for _loading in Auth~Service~Client

I just did a quick search on the auth_client.dart file and the _loading flag is never set to true. Thus, the authentication state inProgress is never returned.

diegonc avatar Nov 29 '22 16:11 diegonc