javascript token things

This commit is contained in:
2021-05-22 20:51:20 +02:00
parent d9d3ada602
commit 1f49ef9f67
2 changed files with 64 additions and 2 deletions

View File

@ -32,6 +32,18 @@ usimp.chooseDomainServer = function (domainServers, invalidDomainServers = []) {
return domainServers[0];
}
usimp.login = function (domainServer, accountName, password) {
return fetch(``)
usimp.login = function (domainServer, domain, account, password) {
return fetch('http://' + domainServer.host + ':' + domainServer.protocols.http + '/_usimp/authenticate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'To-Domain': domain,
'From-Domain': domain
},
body: JSON.stringify({
type: "password",
name: account,
password: password,
}),
});
}