Add custom select-authenticator

This commit is contained in:
Oliver Traber 2023-02-21 21:54:02 +01:00
parent 2e612fc2ad
commit 47b0436b14
Signed by: Bluemedia
GPG key ID: C0674B105057136C
13 changed files with 227 additions and 55 deletions

22
src/functions/utils.ts Normal file
View file

@ -0,0 +1,22 @@
export function formPost(url: string, data: object) {
const form = document.createElement("form");
form.method = "post";
form.action = url;
for (const key in data) {
if (Object.prototype.hasOwnProperty.call(data, key)) {
if (data[key] === undefined) {
continue;
}
const hiddenField = document.createElement("input");
hiddenField.type = "hidden";
hiddenField.name = key;
hiddenField.value = data[key];
form.appendChild(hiddenField);
}
}
document.body.appendChild(form);
form.submit();
}