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
- Request: When Will Appwrite Sites Waitli...
Hey team! 👋 I recently joined the waitlist for Appwrite Sites on Cloud and got the confirmation email that says: "You've successfully joined the Sites waitli...
- AVIF file format as default
In appwrite, is it possible that whenever a user uploads an image it gets converted to a specific format for eg AVIF always? I know I can use cloud functions bu...
- Opening Logs of Function Executions cras...
If I press the "Logs" Button of function exeucutions on the web-console of appwrite, then the websites crashes and I can't navigate anywhere.
