flutter_thingsboard_pe_app icon indicating copy to clipboard operation
flutter_thingsboard_pe_app copied to clipboard

Logout doesn't work

Open alihassan711 opened this issue 2 years ago • 0 comments

Hi, great flutter demo with OAuth2 with ThingsBoard - finally found a sample that actually works! Question more than anything - how is Logout supposed to work? Right now it deletes the refresh token and JWT token, but when you click Login again with the Auth0 link (containing the sign-in page), it re-logs me in using previous credentials. I was expecting a logout that forces the user to sign in again or change credentials. How do you envision that to work? Was that the intention of Logout? Maybe we need PR that does both? Or maybe that's a setting in Auth0 or ThingsBoard connections? thanks - great demo! Below is the code snippet

tbClient.logout();

Future logout({RequestConfig? requestConfig}) async { try { await post('/api/auth/logout', options: defaultHttpOptionsFromConfig(requestConfig)); await _clearJwtToken(); } catch (e) { await _clearJwtToken(); } }

alihassan711 avatar Apr 05 '22 08:04 alihassan711