
Hello, Trying to create a function in node. I followed the example on appwrite.io but receiving the acount.createJWT is not a function
error when i run the function. I'm probably doing something wrong but any help is appreciated. Thanks
const client = new sdk.Client();
client
.setEndpoint('myendpoint')
.setProject('myproject')
.setKey(mykey)
const account = new sdk.Account(client);
const promise = account.createJWT();

ya you can't really do that...you create JWTs client side when a session exists

ok cool, I wanted customize a form where a user can change their password if they forgot or whatever. I was going to create a function to do that.

How would I get a jwt client side using flutter?

Why create a function? We have https://appwrite.io/docs/client/account?sdk=web-default#accountCreateRecovery

nvm, i found it in the docs

Well I wanted a customized email, but I guess if that is the only way.

I see...
I'm not quite sure why you want a JWT token for this...if they need to recover their password, they can't generate a JWT token 🧐

Kind of learning this as I go. lol, that makes sense. I guess I will just use the account recovery endpoint

I forgot, I couldn't use the email verification endpoint because in Flutter I am using goRouter and I couldn't get the params in the verification email to work with it. So i am sure it will be the same issue with the password recovery email. I'll give it a shot.

Go router can't handle query params??

Yes It can. But I was having trouble extracting them from the link for some reason. I'll have to revisit it. I think it had something to do with the %
sign in the link, which I know is standard on the web. I believe goRouter worked when the params are like this www.example.com/param1/param2
Thats how I got it working with the email verification

You could make functions...but you'll need to recreate everything the create recovery API does including managing the secret

You were using queryParams, right?
https://docs.page/csells/go_router/parameters#query-parameters

😟

Yep, here is an example in one of my routes. GoRoute(
name: 'emailVerification',
path: '/emailVerification/:userId/:secret',
pageBuilder: (context, state) => MaterialPage<void>(
key: state.pageKey,
child: VerifiedEmailPage(
userId: state.params['userId'],
secret: state.params['secret'],
)),
),

You're using state.params. query params are in state.queryParams

that is not query params I know, let me revist

Thank You
Recommended threads
- Doing the React TMDB movies tutorial, is...
At the point where I created a brand new app on appwrite but cannot instantiate the react platform without cloning a whole other app and doing some ping button ...
- custom requirements.txt file
How do I specify a custom requirements.txt file when creating a serverless function through the Appwrite console?
- Is my approach for deleting registered u...
A few weeks ago, I was advised not to use the registered users' id in my web app. Instead, I store the publicly viewable information such as username and email ...
