Specify the expiration on the client. Currently this is 100 years.

I am not sure if this is the best approach, or if we should introduce a magic value instead.
This commit is contained in:
Johannes Zellner
2016-06-07 15:54:30 +02:00
parent facdabcc8d
commit 17d48f3fce
2 changed files with 5 additions and 3 deletions

View File

@@ -549,8 +549,8 @@ angular.module('Application').service('Client', ['$http', 'md5', 'Notification',
}).error(defaultErrorHandler(callback));
};
Client.prototype.createTokenByClientId = function (id, callback) {
$http.post(client.apiOrigin + '/api/v1/oauth/clients/' + id + '/tokens').success(function(data, status) {
Client.prototype.createTokenByClientId = function (id, expiresAt, callback) {
$http.post(client.apiOrigin + '/api/v1/oauth/clients/' + id + '/tokens?expiresAt=' + expiresAt).success(function(data, status) {
if (status !== 201) return callback(new ClientError(status, data));
callback(null, data.token);
}).error(defaultErrorHandler(callback));