auth0-flutter
auth0-flutter copied to clipboard
Credentials on Android have incorrect expiresAt value
Checklist
- [X] The issue can be reproduced in the auth0_flutter sample app (or N/A).
- [X] I have looked into the Readme, Examples, and FAQ and have not found a suitable solution or answer.
- [X] I have looked into the API documentation and have not found a suitable solution or answer.
- [X] I have searched the issues and have not found a suitable solution or answer.
- [X] I have searched the Auth0 Community forums and have not found a suitable solution or answer.
- [X] I agree to the terms within the Auth0 Code of Conduct.
Description
When I login on Android, the returned Credentials object has an expiresAt value that is off by 7 hours.
Here is the relevant code snippet from the sample app with a print statement that I added:
final result = await webAuth.login(
redirectUrl: dotenv.env['AUTH0_REDIRECT_URI'],
audience: dotenv.env['AUTH0_AUDIENCE'],
);
setState(() {
_isLoggedIn = true;
});
output = result.idToken;
print(result.expiresAt.difference(DateTime.now()));
I would expect this to be close to my access token lifetime of 5 minutes.
Here is the printed value that I get: -6:55:01.311274
Reproduction
- Login on Android
- Read the
expiresAtvalue in the returnedCredentialsobject - Observe the difference between the
expiresAtvalue andDateTime.now()
Additional context
No response
auth0_flutter version
1.6.0
Flutter version
3.16.9
Platform
Android
Platform version(s)
No response
It looks like this is related to https://github.com/auth0/auth0-flutter/pull/469