Remove oauth client wrapper
This commit is contained in:
@@ -1233,81 +1233,6 @@ angular.module('Application').service('Client', ['$http', '$interval', '$timeout
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.getOAuthClients = function (callback) {
|
||||
get('/api/v1/clients', null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null, data.clients);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.createOAuthClient = function (appId, scope, redirectURI, callback) {
|
||||
var data = {
|
||||
appId: appId,
|
||||
scope: scope,
|
||||
redirectURI: redirectURI
|
||||
};
|
||||
|
||||
post('/api/v1/clients', data, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 201) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null, data.clients);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.delOAuthClient = function (id, callback) {
|
||||
del('/api/v1/clients/' + id, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 204) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.createTokenByClientId = function (id, scope, expiresAt, name, callback) {
|
||||
var data = {
|
||||
scope: scope,
|
||||
expiresAt: expiresAt,
|
||||
name: name || ''
|
||||
};
|
||||
|
||||
post('/api/v1/clients/' + id + '/tokens', data, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 201) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null, data.token);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.getTokensByClientId = function (id, callback) {
|
||||
get('/api/v1/clients/' + id + '/tokens', null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 200) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null, data.tokens);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.delTokensByClientId = function (id, callback) {
|
||||
del('/api/v1/clients/' + id + '/tokens', null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 204) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.delToken = function (clientId, tokenId, callback) {
|
||||
del('/api/v1/clients/' + clientId + '/tokens/' + tokenId, null, function (error, data, status) {
|
||||
if (error) return callback(error);
|
||||
if (status !== 204) return callback(new ClientError(status, data));
|
||||
|
||||
callback(null);
|
||||
});
|
||||
};
|
||||
|
||||
Client.prototype.addAppPassword = function (identifier, name, callback) {
|
||||
var data = {
|
||||
identifier: identifier,
|
||||
|
||||
Reference in New Issue
Block a user