creating a new jwt when open the app for earch server
May as well do this to keep jwt's fresh
This commit is contained in:
parent
d7e57c0751
commit
efb8aa94de
@ -1,3 +1,4 @@
|
||||
const auth = require('./auth.js')
|
||||
|
||||
/**
|
||||
* @param {String} id HTML ID
|
||||
@ -6,7 +7,7 @@
|
||||
*
|
||||
* @returns HTMLElement
|
||||
*/
|
||||
exports.new_node = function (id, type, attrs) {
|
||||
exports.new_node = function new_node(id, type, attrs) {
|
||||
let node = document.createElement(type)
|
||||
if(id) { node.id = id; }
|
||||
|
||||
@ -31,7 +32,13 @@ exports.build_server_list = function (config, dom_id) {
|
||||
|
||||
let container = document.getElementById(dom_id)
|
||||
|
||||
for(const server of config['servers']) {
|
||||
for(let server of config['servers']) {
|
||||
// Request a new token so that further functions don't accidently try to use
|
||||
// an old token
|
||||
if(!('jwt' in server)) {
|
||||
auth.request_new_token(server)
|
||||
}
|
||||
|
||||
const id = server['domain'] || server['ip']
|
||||
|
||||
let child = html.new_node(id, 'button', {
|
||||
|
Loading…
Reference in New Issue
Block a user