mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 13:29:05 +01:00
Fix #5: /api/jwt/ request method
This commit is contained in:
parent
82720c7580
commit
dc6234088b
@ -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))
|
||||||
}))
|
}))
|
||||||
|
Loading…
Reference in New Issue
Block a user