Ensure that we do not proceed execution after calling the listerer's onFailure
This commit is contained in:
parent
7a12300ce6
commit
873d0ecd09
|
@ -1071,9 +1071,10 @@ public final class TokenService {
|
||||||
if (decryptedTokens.length != 2) {
|
if (decryptedTokens.length != 2) {
|
||||||
logger.warn("Decrypted tokens string is not correctly formatted");
|
logger.warn("Decrypted tokens string is not correctly formatted");
|
||||||
listener.onFailure(invalidGrantException("could not refresh the requested token"));
|
listener.onFailure(invalidGrantException("could not refresh the requested token"));
|
||||||
|
} else {
|
||||||
|
listener.onResponse(new Tuple<>(prependVersionAndEncodeAccessToken(refreshTokenStatus.getVersion(), decryptedTokens[0]),
|
||||||
|
prependVersionAndEncodeRefreshToken(refreshTokenStatus.getVersion(), decryptedTokens[1])));
|
||||||
}
|
}
|
||||||
listener.onResponse(new Tuple<>(prependVersionAndEncodeAccessToken(refreshTokenStatus.getVersion(), decryptedTokens[0]),
|
|
||||||
prependVersionAndEncodeRefreshToken(refreshTokenStatus.getVersion(), decryptedTokens[1])));
|
|
||||||
} catch (GeneralSecurityException | IOException e) {
|
} catch (GeneralSecurityException | IOException e) {
|
||||||
logger.warn("Could not get stored superseding token values", e);
|
logger.warn("Could not get stored superseding token values", e);
|
||||||
listener.onFailure(invalidGrantException("could not refresh the requested token"));
|
listener.onFailure(invalidGrantException("could not refresh the requested token"));
|
||||||
|
|
Loading…
Reference in New Issue