Fix #5: /api/jwt/ request method

This commit is contained in:
Lou Knauer 2022-03-15 08:36:45 +01:00
parent 82720c7580
commit dc6234088b

View File

@ -79,9 +79,7 @@
listElement.querySelectorAll('button.get-jwt').forEach(e => e.addEventListener('click', event => { listElement.querySelectorAll('button.get-jwt').forEach(e => e.addEventListener('click', event => {
let row = event.target.parentElement.parentElement let row = event.target.parentElement.parentElement
let username = row.children[0].innerText let username = row.children[0].innerText
let formData = new FormData() fetch(`/api/jwt/?username=${username}`)
formData.append('username', username)
fetch('/api/jwt/', { method: 'POST', body: formData })
.then(res => res.text()) .then(res => res.text())
.then(text => alert(text)) .then(text => alert(text))
})) }))