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
- My account is blocked so please check an...
My account is blocked so please unblock my account because all the apps are closed due to which it is causing a lot of problems
- Applying free credits on Github Student ...
So this post is kind of related to my old post where i was charged 15usd by mistake. This happens when you are trying to apply free credits you got from somewh...
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...