Skip to content

Commit

Permalink
reject getAccessToken promise if expired
Browse files Browse the repository at this point in the history
OKTA-364542
<<<Jenkins Check-In of Tested SHA: db36f41 for [email protected]>>>
Artifact: okta-react-native

(cherry picked from commit a51d91b)
  • Loading branch information
NikitaAvraimov-okta committed Jan 29, 2021
1 parent aaea045 commit 92a7654
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public void getAccessToken(final Promise promise) {
final SessionClient sessionClient = webClient.getSessionClient();
final Tokens tokens = sessionClient.getTokens();

final String accessToken = tokens.getAccessToken();
final String accessToken = tokens.isAccessTokenExpired() ? null : tokens.getAccessToken();
if (accessToken != null) {
params.putString(OktaSdkConstant.ACCESS_TOKEN_KEY, accessToken);
promise.resolve(params);
Expand Down

0 comments on commit 92a7654

Please sign in to comment.