Add custom select-authenticator
This commit is contained in:
parent
2e612fc2ad
commit
47b0436b14
13 changed files with 227 additions and 55 deletions
22
src/functions/utils.ts
Normal file
22
src/functions/utils.ts
Normal 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();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue