Skip to content
This repository has been archived by the owner on Dec 12, 2018. It is now read-only.

Commit

Permalink
Implement OAuth authentication result deleting
Browse files Browse the repository at this point in the history
Add functionality when the result of OAuth access token auth can
be deleted directly, without the need to fetch and construct a new
resource. Shave off several API calls.
  • Loading branch information
Luka Skukan committed Feb 13, 2017
1 parent e390152 commit 5437cbc
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/oauth/stormpath-access-token-authentication-result.js
Expand Up @@ -99,4 +99,17 @@ StormpathAccessTokenAuthenticationResult.prototype.getApplication = function get
this.client.getApplication(this.application.href, args.options, require('../resource/Application'), args.callback);
};

/**
* @function
*
* @description Delete the access token used to authenticate.
*
* @param {Function} callback
* The callback to call after the resource is deleted, with parameters (err, null)
*/
StormpathAccessTokenAuthenticationResult.prototype.deleteAccessToken = function deleteAccessToken(/* callback */) {
var args = utils.resolveArgs(arguments, ['callback']);
this.client.deleteResource({href: this.href}, args.callback);
};

module.exports = StormpathAccessTokenAuthenticationResult;

0 comments on commit 5437cbc

Please sign in to comment.