thingsboard / flutter_thingsboard_app

ThingsBoard Mobile Application
https://thingsboard.io/products/mobile/
BSD 3-Clause "New" or "Revised" License
208 stars 155 forks source link

When i login in flutter app it automatically gets loggout #5

Closed sarthakshivhare99 closed 3 months ago

sarthakshivhare99 commented 2 years ago

Hey, first i have changed the url to my own server and then I logging it gets authenticated but suddenly it gets logged out and back to the login page.

IoTThinks commented 2 years ago

For me, it is ok. Can even off the app and open without login again.

HuzefaGadi commented 2 years ago

The reason for this issue is alot of things. so simply put, the codebase is made such that if it gets any errors in the API it calls, it will simply log you out. I was facing the same issue, I went in the code and found that it is using an API to get home dashboard of the user and the API doesn't even exist. I fixed it and it worked.

there are a lot of bugs in it as well, as the dashboards never load because they forgot to set the state of the isloading to false and because of that the loading icons comes up always.

IoTThinks commented 2 years ago

@HuzefaGadi My app is now spinning forever. Even can not reach the login box. Any hint on the errors? Thanks million.

HuzefaGadi commented 2 years ago

need to see the logs and might have to debug it. I am free for next 15 mins. I can help. let me know if we can zoom

IoTThinks commented 2 years ago

I will put the log in this github when I am back to the project next week. Thanks a lot for your time.

LAMEtHIng commented 2 years ago

The reason for this issue is alot of things. so simply put, the codebase is made such that if it gets any errors in the API it calls, it will simply log you out. I was facing the same issue, I went in the code and found that it is using an API to get home dashboard of the user and the API doesn't even exist. I fixed it and it worked.

there are a lot of bugs in it as well, as the dashboards never load because they forgot to set the state of the isloading to false and because of that the loading icons comes up always.

Sorry to hijack this a bit but @HuzefaGadi could you further explain your fix for the dashboard never loading? There are no variables or anything related to "isloading" in the code -- is it something in the tb_progress_indicator.dart? I have the issue only for certain users and after a long period of having the app open. It is very hard to reproduce so I was hoping to try what you have referenced. Thanks.

Haris-a commented 1 year ago

It only works for android 11 or below!

HuzefaGadi commented 1 year ago

@LAMEtHIng I have a PR in place. dont know where to post it.

ybeshkarov commented 3 months ago

the codebase is made such that if it gets any errors in the API it calls, it will simply log you out.