nhost / nhost-dart

Nhost Dart & Flutter packages
https://nhost.io
MIT License
90 stars 32 forks source link

Add changePassword with Ticket for not logged in user #94

Open lennyd7 opened 1 year ago

lennyd7 commented 1 year ago

I want to add the password with ticket option https://docs.nhost.io/reference/javascript/auth/change-password as a forget password feature for our users. The current changePassword method is only available for logged-in users.

The issue relates to the flow and PRs described here https://github.com/nhost/nhost/issues/594.

mhadaily commented 1 year ago

The ticket param was added to the changePassword method. However, it's available in our newest DEV version for Dart SDK.

You can check https://pub.dev/packages/nhost_sdk/versions/4.0.0-dev.8

The new SDK requires you to pass subdomain and region instead of the backendUrl.

vipafattal commented 1 year ago

@mhadaily I already migrated to V3.0 but am having trouble implementing the rest password in my web app.

I use the restPassword(email: userEmail) method, then I receive a mail that redirects to my app as follows MY_FRONT_END_URL/refreshToken=9e1e0d6a-b1bc-4612-9f78-8721d59bd5a4&type=passwordReset but the new change password method needs a ticket number and I am unsure where to get that from.

Any tips? thanks in advance.

mhadaily commented 1 year ago

I am unsure I need to investigate a bit, because as far as the SDK implementation, we just call an endpoint in the backend of nhost, let me ask around and give you an answer.

vipafattal commented 1 year ago

Hi @mhadaily any updates on this? thanks

mhadaily commented 1 year ago

Unfortunately, I was pulled out of it for an unforeseeable future.
I still have access, but I need to confirm everything with @nunopato

vipafattal commented 1 year ago

Do you have any docs on how to implement forget the password feature? As it's not really clear how to utilize the refreshToken that is delivered to the user's mail.