Skip to content
Snippets Groups Projects
Verified Commit 39f4f891 authored by Gabriel Zachmann's avatar Gabriel Zachmann
Browse files

fix tokeninfo remote info

parent ef725ec9
No related branches found
No related tags found
No related merge requests found
......@@ -36,7 +36,7 @@ async function update_tokeninfo() {
fillTokenInfo(payload);
return;
}
let tokeninfoEndpoint = storageGet('tokeninfo_endpoint');
tokeninfoEndpointToUse = storageGet('tokeninfo_endpoint');
let jwksUri = storageGet('jwks_uri');
transferEndpoint = "";
try {
......@@ -52,7 +52,7 @@ async function update_tokeninfo() {
await fetch(url).then(function (res) {
return res.json();
}).then(function (data) {
tokeninfoEndpoint = data['tokeninfo_endpoint'];
tokeninfoEndpointToUse = data['tokeninfo_endpoint'];
jwksUri = data['jwks_uri'];
transferEndpoint = data['token_transfer_endpoint'];
}).catch(function (e) {
......@@ -78,7 +78,7 @@ async function update_tokeninfo() {
try {
await $.ajax({
type: "POST",
url: tokeninfoEndpoint,
url: tokeninfoEndpointToUse,
data: JSON.stringify({
'action': 'introspect',
'mytoken': token,
......
const $tokenInput = $('#tokeninfo-token');
let tokeninfoEndpointToUse;
function _tokeninfo(action, successFnc, errorFnc, token = undefined) {
let data = {
'action': action
......@@ -10,7 +12,7 @@ function _tokeninfo(action, successFnc, errorFnc, token = undefined) {
data = JSON.stringify(data);
$.ajax({
type: "POST",
url: storageGet('tokeninfo_endpoint'),
url: tokeninfoEndpointToUse,
data: data,
success: successFnc,
error: errorFnc,
......@@ -222,6 +224,7 @@ const listMsg = $('#list-msg');
const listCopy = $('#list-copy');
function _getListTokenInfo(token) {
tokeninfoEndpointToUse = storageGet("tokeninfo_endpoint");
_tokeninfo('list_mytokens',
function (infoRes) {
listMsg.html(tokenlistToHTML(infoRes['mytokens'], revocationClassFromTokenList));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment