Created
June 4, 2018 16:41
-
-
Save transducer/0ddc1e126bc65b7f0f97bf9d50a93afa to your computer and use it in GitHub Desktop.
Process an authorization revoked message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Process MAM message revoked: authorization | |
* @param message {Object} MAM message of type {@link AUTHORIZATION_REVOKED_TYPE}. | |
* @returns {undefined} | |
*/ | |
processAuthorizationRevokedMessage(message) { | |
const newSideKey = DeviceClient.createSideKey(); | |
this.authorizedServiceProviders.remove(message.policy.serviceProvider); | |
this.informUpdateSideKey( | |
this.authorizedServiceProviders.getAll(), | |
newSideKey, | |
) | |
.then(() => this.mam.changeSideKey(newSideKey)) | |
.catch(err => logger.error(`processAuthorizationRevokedMessage failed: ${err}`)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment