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
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...
- custom domain with CloudFlare
Hi all, it seems that CloudFlare has blocked cross-domain CNAME link which made my app hostname which is in CloudFlare, unable to create a CNAME pointing to clo...
- Custom emails
What happen if I use a third party email provider to customize my emails and my plan run out of emails/month? Appwrite emails are used as fallback sending emai...