i hate rebase

This commit is contained in:
Modo 2023-10-25 23:43:05 +05:30
parent b1ef6a6b8f
commit 60f843b6d2
10 changed files with 44 additions and 75 deletions

4
.gitignore vendored
View File

@ -1,8 +1,4 @@
*__pycache__* *__pycache__*
/node_modules /node_modules
<<<<<<< HEAD
=======
/devfolder /devfolder
.vscode .vscode
>>>>>>> 0d9e690db10b6dfbef3d9aa4316e52d1e8cb8f6a

View File

@ -20,18 +20,6 @@ def handle_first_launched():
mkdir(folder_path) mkdir(folder_path)
@app.route('/favicon.ico')
def favicon() -> Response:
favicon_path: str = path.join(app.root_path, '../frontend/static', 'favicon.ico')
return send_file(favicon_path, mimetype='image/vnd.microsoft.icon')
@app.route("/index.html")
def handle_index() -> Response:
index_path: str = path.join(app.root_path, "../frontend/html", "index.html")
return send_file(index_path, mimetype="text/html")
@app.get("/") @app.get("/")
@app.get("/<path:url_path>") @app.get("/<path:url_path>")
def handle_get(url_path: str = "html/index.html") -> Response: def handle_get(url_path: str = "html/index.html") -> Response:
@ -466,3 +454,10 @@ class QueryHandler:
) )
return Response(status=200) return Response(status=200)
import os
from os import path
@app.route('/favicon.ico')
def favicon():
favicon_path = os.path.join(app.root_path, 'static', 'favicon.ico')
return send_file(favicon_path, mimetype='image/vnd.microsoft.icon')

View File

@ -3,6 +3,13 @@
<head> <head>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8"> <meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://fonts.googleapis.com;
font-src 'self' https://fonts.gstatic.com;
connect-src 'self' http://127.0.0.1:5000;
style-src 'self' https://fonts.googleapis.com 'unsafe-inline';
script-src 'self' 'unsafe-inline';
script-src-elem 'self' 'unsafe-inline';
img-src 'self' http://www.google.com/s2/favicons https://t1.gstatic.com https://t0.gstatic.com https://t2.gstatic.com">
<title>DashBoard</title> <title>DashBoard</title>
<link rel="stylesheet" href="../styles/dashboard.css"/> <link rel="stylesheet" href="../styles/dashboard.css"/>
</head> </head>
@ -165,4 +172,3 @@
<footer><p>© 2023 Password Manager</p></footer> <footer><p>© 2023 Password Manager</p></footer>
</html> </html>

View File

@ -3,6 +3,14 @@
<html> <html>
<head> <head>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8"> <meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://fonts.googleapis.com;
font-src 'self' https://fonts.gstatic.com;
connect-src 'self' http://127.0.0.1:5000;
style-src 'self' https://fonts.googleapis.com 'unsafe-inline';">
<meta
http-equiv="X-Content-Security-Policy"
content="default-src 'self'; script-src 'self'"
/>
<link rel="stylesheet" href="../styles/index.css"/> <link rel="stylesheet" href="../styles/index.css"/>
<title>Login</title> <title>Login</title>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
@ -24,9 +32,6 @@
</div> </div>
<div class="help"> <div class="help">
<div>
<a href="" id="forgot_password">Forgot Password</a>
</div>
<div> <div>
<a href="register.html" id="register">Register</a> <a href="register.html" id="register">Register</a>
</div> </div>

View File

@ -3,6 +3,12 @@
<html> <html>
<head> <head>
<meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8"> <meta http-equiv="CONTENT-TYPE" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Security-Policy" content="default-src 'self' https://fonts.googleapis.com;
font-src 'self' https://fonts.gstatic.com;
connect-src 'self' http://127.0.0.1:5000;
style-src 'self' https://fonts.googleapis.com 'unsafe-inline';
script-src 'self' 'unsafe-inline';
script-src-elem 'self' 'unsafe-inline'">
<link rel="stylesheet" href="../styles/register.css"/> <link rel="stylesheet" href="../styles/register.css"/>
<link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>

View File

@ -14,9 +14,11 @@
//-----------------------------------------------------------------------------------------(Getting Data) //-----------------------------------------------------------------------------------------(Getting Data)
const PORT = 5000;
async function getData() { async function getData() {
try { try {
let response = await fetch('/get_data', { let response = await fetch(`http://127.0.0.1:${PORT}/get_data`, {
method: 'POST', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
@ -223,7 +225,7 @@ const errorlabel = document.querySelector('.fieldcontainer label')
async function sendData(formData){ async function sendData(formData){
try { try {
const response = await fetch('/add_entry', { const response = await fetch(`http://127.0.0.1:${PORT}/add_entry`, {
method: "POST", method: "POST",
body: formData body: formData
}); });
@ -401,7 +403,7 @@ async function deleteEntry() {
const formData = new FormData() const formData = new FormData()
formData.append("entry_name", localStorage.getItem("editVal")) formData.append("entry_name", localStorage.getItem("editVal"))
try { try {
const response = await fetch('/delete_entry', { const response = await fetch(`http://127.0.0.1:${PORT}/delete_entry`, {
method: "POST", method: "POST",
body: formData body: formData
}); });
@ -479,7 +481,7 @@ async function sendPass(password) {
const formData = new FormData() const formData = new FormData()
formData.append("password", password) formData.append("password", password)
try { try {
const response = await fetch('/change_password', { const response = await fetch(`http://127.0.0.1:${PORT}/change_password`, {
method: "POST", method: "POST",
body: formData body: formData
}); });
@ -599,7 +601,7 @@ async function addNewField(sitename, field, value) {
formData.append("field_value", value) formData.append("field_value", value)
try { try {
const response = await fetch('/add_field', { const response = await fetch(`http://127.0.0.1:${PORT}/add_field`, {
method: "POST", method: "POST",
body: formData body: formData
}); });
@ -628,7 +630,7 @@ async function editFieldValue(sitename, field, value) {
formData.append("field_value", value) formData.append("field_value", value)
try { try {
const response = await fetch('/edit_field_value', { const response = await fetch(`http://127.0.0.1:${PORT}/edit_field_value`, {
method: "POST", method: "POST",
body: formData body: formData
}); });
@ -655,7 +657,7 @@ async function changeEntryName(entryname, sitename) {
formData.append("new_entry_name", sitename) formData.append("new_entry_name", sitename)
try { try {
const response = await fetch('/edit_entry_name', { const response = await fetch(`http://127.0.0.1:${PORT}/edit_entry_name`, {
method: "POST", method: "POST",
body: formData body: formData
}); });
@ -795,7 +797,7 @@ function closePopup() {
async function logOut() { async function logOut() {
try{ try{
await fetch("/logout", { await fetch(`http://127.0.0.1:${PORT}/logout`, {
method:'POST', method:'POST',
headers: { headers: {
'Content-Type': 'application/json', 'Content-Type': 'application/json',

View File

@ -118,5 +118,3 @@ window.onload = async function() {
// console.error('Login Failed:', data.error) // console.error('Login Failed:', data.error)
// } // }
// } // }

View File

@ -1,3 +1,4 @@
const errlabel = document.getElementById('errlabel') const errlabel = document.getElementById('errlabel')
function validateRegister() { function validateRegister() {

36
package-lock.json generated
View File

@ -1,5 +1,3 @@
<<<<<<< HEAD
=======
{ {
"name": "unnamed-password-manager", "name": "unnamed-password-manager",
"version": "1.0.0", "version": "1.0.0",
@ -9,39 +7,7 @@
"": { "": {
"name": "unnamed-password-manager", "name": "unnamed-password-manager",
"version": "1.0.0", "version": "1.0.0",
"license": "ISC", "license": "ISC"
"dependencies": {
"cors": "^2.8.5"
}
},
"node_modules/cors": {
"version": "2.8.5",
"resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz",
"integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==",
"dependencies": {
"object-assign": "^4",
"vary": "^1"
},
"engines": {
"node": ">= 0.10"
}
},
"node_modules/object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
"integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==",
"engines": {
"node": ">= 0.8"
} }
} }
} }
}
>>>>>>> b1b896f (Add api request changes)

View File

@ -1,18 +1,12 @@
<<<<<<< HEAD
=======
{ {
"name": "unnamed-password-manager", "name": "unnamed-password-manager",
"version": "1.0.0", "version": "1.0.0",
"description": "Hi", "description": "Hi",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"start": "nodemon devfolder/app.js" "start": ""
}, },
"keywords": [], "keywords": [],
"author": "", "author": "",
"license": "ISC", "license": "ISC"
"dependencies": {
"cors": "^2.8.5"
} }
}
>>>>>>> b1b896f (Add api request changes)