Rank 3: Container
Hello, has been a long time, I have a question:
Recently I have started getting this error on Appwrite 1.2.1: Appwrite Exception: general unauthorized scope
I dont know what have changed, but it was working normally and suddenly it doesn't anymore.
I'm using flutter web, and even when I try to connect from the developer browser it works, but when I deploy the code to the server, the error shows up.
This is a portion of the code:
try { await ApiService.instance?.login( email: usernameController.text, password: passwordController.text, ); var resTeam = await ApiService.instance?.getListaEquipos(); Navigator.pushReplacement( context, MaterialPageRoute(builder: (context) => const MyApp()), ); } on AppwriteException catch (e) { print(e); }class ApiService { static ApiService? _instance;
late Client client; late Account account; late Teams teams; late Databases db; late Storage storage; late Functions functions;
ApiService._internal() { Client client = Client(endPoint: AppConstant.endPoint) .setProject(AppConstant.projectid) .setSelfSigned(status: true); account = Account(client); teams = Teams(client); db = Databases(client); storage = Storage(client); functions = Functions(client); }
static ApiService? get instance { _instance ??= ApiService._internal(); return _instance; }
Future<models.Session> login( {required String email, required String password}) async { try { var session = await account.createEmailSession(email: email, password: password); print(session.toMap()); return session; } catch (e) { rethrow; } }
Future getListaEquipos() async { var res = await teams.list(); return res; }Any idea on whats going on?
Any help is really appreciatted.