nhost / nhost-dart

Nhost Dart & Flutter packages

Home Page:https://nhost.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add changePassword with Ticket for not logged in user

lennyd7 opened this issue · comments

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 nhost/nhost#594.

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.

@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.

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.

Hi @mhadaily any updates on this? thanks

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

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.