Amplify 401 You are not authoriz

2023-03-02  本文已影响0人  Hamiltonian

The following issues happened once a month. I hope AWS Engineers could fix it soon.

When I successfully log in then query the data by Flutter Amplify API

Amplify.DataStore.observeQuery(HomePageMediaModel.classType).listen((event) {
       
});

I always get the following error in Android with no data response.
For iOS with no explicit error and no data response.

"errorType":"UnauthorizedException","message":"You are not authorized to make this call.","errorCode":401

My solution is log in Amplify Studio select “Data”, find the data structure of HomePageMediaModel then add a random field (or call it “key”), then click the save and deploy button.

Then It works like magic.

上一篇下一篇

猜你喜欢

热点阅读