From 614c1fbdbffdf50365671aad62dcfb7ee91bce14 Mon Sep 17 00:00:00 2001 From: maaa Date: Thu, 3 Aug 2023 18:41:58 +0200 Subject: [PATCH] burger changes --- main | 7 +++++-- requirements.txt | 3 ++- static/css/style.css | 17 ++++++++++------- static/js/main.js | 1 + templates/signup.html | 5 +++-- 5 files changed, 21 insertions(+), 12 deletions(-) diff --git a/main b/main index b3da86f..0423095 100644 --- a/main +++ b/main @@ -5,6 +5,7 @@ import time import secrets import configparser from waitress import serve +from werkzeug.security import generate_password_hash, check_password_hash from flask import Flask, render_template, request, url_for, flash, redirect, session, make_response, send_from_directory, stream_with_context, Response, request # Parse configuration file, and check if anything is wrong with it @@ -120,9 +121,11 @@ def apisignup(): if not check_username_taken(username) == "error": return {}, 409 + hashedpassword = generate_password_hash(password) + conn = get_db_connection() conn.execute("INSERT INTO users (username, password, created) VALUES (?, ?, ?)", - (username, password, str(time.time()))) + (username, hashedpassword, str(time.time()))) conn.commit() conn.close() @@ -156,7 +159,7 @@ def apilogin(): userID = check_username_taken(username) user = get_user(userID) - if not password == user["password"]: + if not check_password_hash(user["password"], (password)): return {}, 401 randomCharacters = secrets.token_hex(512) diff --git a/requirements.txt b/requirements.txt index 8642e2b..2194384 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,3 @@ flask -waitress \ No newline at end of file +waitress +werkzeug \ No newline at end of file diff --git a/static/css/style.css b/static/css/style.css index 1f08b4a..1a1c22a 100644 --- a/static/css/style.css +++ b/static/css/style.css @@ -168,7 +168,6 @@ body { .inoutdiv { margin: 10%; padding: 15px; - box-shadow: 4px 4px 16px 1px grey; } .inoutdiv input { @@ -177,18 +176,22 @@ body { margin-bottom: 10px; padding-left: 10px; padding-right: 10px; - border-color: gray; + + border: solid; + border-color: rgb(207, 207, 207); border-width: 1px; border-radius: 8px; } .inoutdiv button { - background-color: white; - color: black; + background-color: #157efb; + color: white; padding: 10px; - padding-left: 15px; - padding-right: 15px; - border-color: gray; + padding-left: 20px; + padding-right: 20px; + + border: solid; + border-color: rgb(207, 207, 207); border-width: 1px; border-radius: 8px; } diff --git a/static/js/main.js b/static/js/main.js index bdb5b3f..6df0c13 100644 --- a/static/js/main.js +++ b/static/js/main.js @@ -216,6 +216,7 @@ function updateNotes() { document.querySelectorAll(".noteButton").forEach((el) => el.remove()); noteBox.readOnly = true selectedNote = 0 + noteBox.placeholder = "" noteBox.value = "" clearTimeout(timer) diff --git a/templates/signup.html b/templates/signup.html index cc7d75f..a7979e3 100644 --- a/templates/signup.html +++ b/templates/signup.html @@ -16,9 +16,10 @@

sign up

sign up for a burgernotes account

- - + +

+

please note that it's impossible to reset your password, do not forget it!

already have an account? if so, log in instead