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
- general_route_not_found - Auth Guide
If you’ve just added a subdomain to your project, verified your DNS records, and confirmed your SSL certificate is working, but you're still hitting a `general_...
- Can't resume paused project
I have logged in in incognito, done the email verification and still get the invalid fingerprint error. What's the issue.
- Local appwrite run functions --user-id n...
Hi, I'm running into an issue when testing Appwrite functions locally with user impersonation. I'm using a self-hosted Appwrite instance and running functions ...