etherpad-lite/ui/src/consent.ts
SamTV12345 fb56809e55
Feat/oauth2 (#6281): Added oauth to API paths
* Added oauth provider.

* Fixed provider.

* Added auth flow.

* Fixed auth flow and added scaffolding vite config.

* Added working oauth2.

* Fixed dockerfile.

* Adapted run.sh script

* Moved api tests to oauth2.

* Updated security schemes.

* Removed api key from existance.

* Fixed installation

* Added missing issuer in config.

* Fixed dev dependencies.

* Updated lock file.
2024-03-26 17:11:24 +01:00

35 lines
1.1 KiB
TypeScript

import "./style.css"
//import {MapArrayType} from "ep_etherpad-lite/node/types/MapType";
const form = document.querySelector('form')!;
const sessionId = new URLSearchParams(window.location.search).get('state');
form.action = '/interaction/' + sessionId;
/*form.addEventListener('submit', function (event) {
event.preventDefault();
const formData = new FormData(form);
const data: MapArrayType<any> = {};
formData.forEach((value, key) => {
data[key] = value;
});
const sessionId = new URLSearchParams(window.location.search).get('state');
fetch('/interaction/' + sessionId, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(data),
}).then(response => {
if (response.ok) {
if (response.redirected) {
window.location.href = response.url;
}
} else {
document.getElementById('error')!.innerText = "Error signing in";
}
}).catch(error => {
document.getElementById('error')!.innerText = "Error signing in" + error;
})
});*/