diff --git a/server/api/index.js b/server/api/index.js index b389436..6148c6b 100644 --- a/server/api/index.js +++ b/server/api/index.js @@ -332,6 +332,9 @@ const API = { let auth = await models.OAuth2AuthorizedClient.query().where('user_id', user.id).andWhere('client_id', clientId) if (!auth.length) return false + await models.OAuth2AccessToken.query().delete().where('client_id', clientId).andWhere('user_id', user.id) + await models.OAuth2RefreshToken.query().delete().where('client_id', clientId).andWhere('user_id', user.id) + for (let i in auth) { await models.OAuth2AuthorizedClient.query().delete().where('id', auth[i].id) } diff --git a/server/api/oauth2/model.js b/server/api/oauth2/model.js index fa47bfc..ab51094 100644 --- a/server/api/oauth2/model.js +++ b/server/api/oauth2/model.js @@ -129,7 +129,6 @@ const OAuthDB = { await Models.OAuth2Code.query().delete().where('user_id', userId).andWhere('client_id', clientId) const obj = { code: code, user_id: userId, client_id: clientId, scope: scope, expires_at: expr, created_at: new Date() } - console.log(obj) await Models.OAuth2Code.query().insert(obj) diff --git a/src/script/main.js b/src/script/main.js index 8065132..bfa060d 100644 --- a/src/script/main.js +++ b/src/script/main.js @@ -55,8 +55,11 @@ $(document).ready(function () { if (!data.length) { return $('#clientlist').html('There is nothing to show at this moment.') } - var html = '' + + $('#clientlist').html('') + for (var i in data) { + var html = '' var client = data[i] html += '