An error occurred: app.66b0ff530019305177ae@service.cloud.appwrite.io (role: applications) missing
- 0
- Cloud
When creating jwt token I get this error
An error occurred: app.66b0ff530019305177ae@service.cloud.appwrite.io (role: applications) missing scope (account)
Here's my code.
try { $session = $account->createEmailPasswordSession($email, $password); $jwt = $account->createJWT();
return $context->res->json([
'status' => 'success',
'session' => $session,
'jwt' => $jwt
]);
} catch (Exception $e) {
$context->log('General Exception: ' . $e->getMessage());
return $context->res->json([
'status' => 'error',
'message' => 'An error occurred: ' . $e->getMessage()
]);
}
Session gets created successfully but jwt token returns the above error
Did you set an API key?
Yes I did. Everything was working perfectly until I add this line $jwt = $account->createJWT();
If I comment it out my code works without any issue
Try removing the API key
(Unless there are other places in your code you need it?)
Recommended threads
- Failed to build function: Incorrect prox...
I have a function which I updated. Previously built and deployed just fine. I made some small edits and pushed to github, and now it's failing on the build wit...
- How to protect file url
I generate the url to file in NextJS server action. In client component, i use that url as src image. It works fine when I give Any permission! I want to protec...
- https://discord.com/channels/56416073084...
i want to add email authentication to this from appwrite can anyone help me with that