Back

general_unauthorized_scope, app.xxx@service.cloud.appwrite.io (role: applications)

  • 0
  • Flutter
HiMaNameIs
23 Dec, 2023, 09:37

I'm trying to create an admin app, when i try to reset the password, here's what i'm getting

TypeScript

here is my code

TypeScript
dap.Client client=dap.Client()
      ..setEndpoint(endpoint)
      ..setKey(secretKey)
      ..setProject(project);
      await dap.Account(client).createRecovery(email: email.text,
          url:'https://app.xxx.com/recoverpassword?projectid=$project&endpoint=$endpoint').onError((AppwriteException error, stackTrace) {
            print('message: ${error.message}');
            print('code: ${error.code}');
            print('response: ${error.response}');
            print('type: ${error.type}');
            print('stacktrace: $stackTrace');
            return dam.Token($id: '', $createdAt: '', userId: '', secret: '', expire: '');
      });
      setState(() {
        error="";
      });

the secret key has all the authorizations

TL;DR
The user is reporting an issue with not receiving a password reset email. The issue was due to incorrect SMTP settings. The user suggests reporting this as a bug. The user also mentions that the email is complex because it includes the project ID and endpoint as parameters. The user mentions testing the mail link and it worked fine using the appwrite package. However, it did not work with the dart_appwrite package. The user asks for clarification on what 'dap' means. The user also asks if this is Appwrite cloud or self-hosted. The user also asks about running the code in async. The user states that this is an admin
D5
23 Dec, 2023, 10:43

This is client side code?

HiMaNameIs
23 Dec, 2023, 10:44

This is an admin desktop app code The admin can reset password of users using dart_appwrite, the users of this admin app are prompted to enter their secret keys manually to be able to use the app

By the way, client side's reset password doesn't send the link to emails without showing any error (using appwrite )

D5
24 Dec, 2023, 16:51

Try to run it in async

D5
24 Dec, 2023, 16:52

Is this Appwrite cloud or self-hosted?

HiMaNameIs
24 Dec, 2023, 16:55

It is already running in async

Appwrite cloud

HiMaNameIs
25 Dec, 2023, 16:10

anything ?

D5
25 Dec, 2023, 19:58

What's dap?

D5
25 Dec, 2023, 19:59

And why the URL is that complex?

HiMaNameIs
25 Dec, 2023, 20:05

I'm importing dart_appwrite package as dap

I found why no email was sent with reseting the password, it's because i set an smtp that wasn't working BEFORE appwrite pro is here, but after the free plan was on , there was no way to access it and it seems that smtp settings were kept the same, i have to activate pro in order to remove them, then email was working fine after that I think this should be reported as a bug

Email is complex only to include project id and endpoint as parameters

Just tested the mail link now it works fine using client appwrite(appwrite package)

The one with dart_appwrite doesn't work, still, i can manage without it, so thanks anyway

ideclon
26 Dec, 2023, 02:53

BTW, project ID should be passed automatically - you shouldn’t need to add it yourself. And is the endpoint really different between different reset password requests?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more