Pass scope and expiresAt as body params
This commit is contained in:
@@ -767,8 +767,12 @@ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'N
|
||||
}).error(defaultErrorHandler(callback));
|
||||
};
|
||||
|
||||
Client.prototype.createTokenByClientId = function (id, expiresAt, callback) {
|
||||
post('/api/v1/oauth/clients/' + id + '/tokens?expiresAt=' + expiresAt).success(function(data, status) {
|
||||
Client.prototype.createTokenByClientId = function (id, scope, expiresAt, callback) {
|
||||
var data = {
|
||||
scope: scope,
|
||||
expiresAt: expiresAt
|
||||
};
|
||||
post('/api/v1/oauth/clients/' + id + '/tokens, data).success(function(data, status) {
|
||||
if (status !== 201) return callback(new ClientError(status, data));
|
||||
callback(null, data.token);
|
||||
}).error(defaultErrorHandler(callback));
|
||||
|
||||
Reference in New Issue
Block a user