little changes
This commit is contained in:
parent
9b7bc571e0
commit
33944ae599
@ -332,6 +332,9 @@ const API = {
|
|||||||
let auth = await models.OAuth2AuthorizedClient.query().where('user_id', user.id).andWhere('client_id', clientId)
|
let auth = await models.OAuth2AuthorizedClient.query().where('user_id', user.id).andWhere('client_id', clientId)
|
||||||
if (!auth.length) return false
|
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) {
|
for (let i in auth) {
|
||||||
await models.OAuth2AuthorizedClient.query().delete().where('id', auth[i].id)
|
await models.OAuth2AuthorizedClient.query().delete().where('id', auth[i].id)
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,6 @@ const OAuthDB = {
|
|||||||
await Models.OAuth2Code.query().delete().where('user_id', userId).andWhere('client_id', clientId)
|
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() }
|
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)
|
await Models.OAuth2Code.query().insert(obj)
|
||||||
|
|
||||||
|
@ -55,8 +55,11 @@ $(document).ready(function () {
|
|||||||
if (!data.length) {
|
if (!data.length) {
|
||||||
return $('#clientlist').html('There is nothing to show at this moment.')
|
return $('#clientlist').html('There is nothing to show at this moment.')
|
||||||
}
|
}
|
||||||
var html = ''
|
|
||||||
|
$('#clientlist').html('')
|
||||||
|
|
||||||
for (var i in data) {
|
for (var i in data) {
|
||||||
|
var html = ''
|
||||||
var client = data[i]
|
var client = data[i]
|
||||||
html += '<div class="authclient application" data-client-id="' + client.id + '" id="client-' + client.id + '">'
|
html += '<div class="authclient application" data-client-id="' + client.id + '" id="client-' + client.id + '">'
|
||||||
html += '<div class="remove" id="deleteclient"><i class="fa fa-fw fa-ban"></i></div>'
|
html += '<div class="remove" id="deleteclient"><i class="fa fa-fw fa-ban"></i></div>'
|
||||||
@ -75,13 +78,11 @@ $(document).ready(function () {
|
|||||||
html += '<a class="url" href="' + client.url + '">' + client.url + '</a>'
|
html += '<a class="url" href="' + client.url + '">' + client.url + '</a>'
|
||||||
html += '<div class="timestamp">Authorized ' + new Date(client.created_at) + '</div>'
|
html += '<div class="timestamp">Authorized ' + new Date(client.created_at) + '</div>'
|
||||||
html += '</div></div>'
|
html += '</div></div>'
|
||||||
}
|
|
||||||
|
|
||||||
$('#clientlist').html(html)
|
$('#clientlist').append(html)
|
||||||
|
|
||||||
for (let i in data) {
|
$('#client-' + client.id + ' #deleteclient').click(function (e) {
|
||||||
$('#client-' + data[i].id + ' #deleteclient').click(function (e) {
|
var clid = $(this).parent().data('client-id')
|
||||||
let clid = $(this).parent().data('client-id')
|
|
||||||
if (clid != null) {
|
if (clid != null) {
|
||||||
removeAuthorization(clid)
|
removeAuthorization(clid)
|
||||||
}
|
}
|
||||||
|
@ -61,7 +61,7 @@ block body
|
|||||||
i.fa.fa-fw.fa-envelope
|
i.fa.fa-fw.fa-envelope
|
||||||
|Change Email Address
|
|Change Email Address
|
||||||
.clients
|
.clients
|
||||||
h2 OAuth2 Authorized Clients
|
h2 OAuth2 Authorized Applications
|
||||||
.cl#clientlist
|
.cl#clientlist
|
||||||
span.load
|
span.load
|
||||||
i.fa.fa-spin.fa-spinner.fa-2x
|
i.fa.fa-spin.fa-spinner.fa-2x
|
||||||
|
Reference in New Issue
Block a user