Open nicolas-idata opened 5 years ago
Same issue
Same issue
Any support refresh token ?
I found temporary solution I write one function in UserService class
Future<String> getIdToken() async {
if (_session == null || _session.idToken == null) {
return null;
}
if (!_session.isValid()) {
print("Refreshing Token...");
_session = await _cognitoUser.getSession();
}
return _session.idToken?.getJwtToken();
}
I hope you can help me.
When i generate a token using getIdToken().getJwtToken() it works great, the problem is that i dont know how to deal with refresh. So, eventually the token expires and i get a 401 error.
Can anyone please tell me how can i get a new token ? thanks!
Nick