mirror of
https://github.com/arc53/DocsGPT
synced 2024-11-03 23:15:37 +00:00
Merge pull request #45 from masslightsquared/authapi_update
updated authapi.js
This commit is contained in:
commit
7b648834f4
@ -1,15 +1,19 @@
|
||||
function resetApiKey() {
|
||||
document.getElementById('modal').classList.toggle('hidden')
|
||||
const modal = document.getElementById("modal");
|
||||
modal.classList.toggle("hidden");
|
||||
}
|
||||
|
||||
const apiKeyForm = document.getElementById("api-key-form");
|
||||
if (apiKeyForm) {
|
||||
apiKeyForm.addEventListener("submit", function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
var el2 = document.getElementById('api-key-form');
|
||||
if (el2) {
|
||||
el2.addEventListener("submit", function (event) {
|
||||
event.preventDefault()
|
||||
var apiKey = document.getElementById("api-key-input").value;
|
||||
document.getElementById('modal').classList.toggle('hidden')
|
||||
localStorage.setItem('apiKey', apiKey)
|
||||
document.getElementById('api-key-input').value = ''
|
||||
});
|
||||
const apiKeyInput = document.getElementById("api-key-input");
|
||||
const apiKey = apiKeyInput.value;
|
||||
|
||||
localStorage.setItem("apiKey", apiKey);
|
||||
|
||||
apiKeyInput.value = "";
|
||||
modal.classList.toggle("hidden");
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user