make the password a password field and add username when uploading the file

This commit is contained in:
csd4ni3l
2025-08-09 12:45:46 +02:00
parent c0eb5b59dd
commit 75ac77dea8
2 changed files with 4 additions and 3 deletions

View File

@@ -13,7 +13,7 @@
<div class="form-group" style="margin-top: 4%;"> <div class="form-group" style="margin-top: 4%;">
<label for="passwordinput">Password</label> <label for="passwordinput">Password</label>
<input name="password" class="form-control" id="passwordinput" placeholder="Enter password"> <input type="password" name="password" class="form-control" id="passwordinput" placeholder="Enter password">
</div> </div>
<button id="submit" type="submit" class="btn btn-primary mx-auto d-block" style="width: 100%; margin-top: 4%;">Submit</button> <button id="submit" type="submit" class="btn btn-primary mx-auto d-block" style="width: 100%; margin-top: 4%;">Submit</button>
</form> </form>

View File

@@ -13,7 +13,7 @@
<div class="form-group" style="margin-top: 4%;"> <div class="form-group" style="margin-top: 4%;">
<label for="passwordinput">Password</label> <label for="passwordinput">Password</label>
<input name="password" class="form-control" id="passwordinput" placeholder="Enter password"> <input type="password" name="password" class="form-control" id="passwordinput" placeholder="Enter password">
</div> </div>
<div class="form-group" style="margin-top: 4%;"> <div class="form-group" style="margin-top: 4%;">
@@ -51,9 +51,10 @@ function upload_error(error_message) {
} }
function upload_file(file_type, file_content) { function upload_file(file_type, file_content) {
username_input = document.getElementById("usernameinput").value
fetch('{{ url_for("upload") }}', { fetch('{{ url_for("upload") }}', {
method: "POST", method: "POST",
body: JSON.stringify({image_data: file_content, image_type: file_type}), body: JSON.stringify({image_data: file_content, image_type: file_type, username: username_input}),
headers: { headers: {
"Content-type": "application/json" "Content-type": "application/json"
} }