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
- The file size is either not valid or exc...
Hello, I am receiving the following error when I am trying to deploy a function from my local. ``` > appwrite push functions --function-id xxxxxxxxx ā¹ Info: Va...
- i need help!
I was working on my project and I just can't stop receiving this message. Is something wrong?
- Request for JWKS Endpoint and OIDC Disco...
Hey Appwrite Team, Do you have plans to support JWKS and a well-known OIDC discovery endpoint? This would let us verify Appwrite JWTs in other services using st...