First fully working user management, move to layout groups

This commit is contained in:
2023-07-18 14:18:52 +02:00
parent 70e640aa9a
commit 7dd52d8890
55 changed files with 366 additions and 192 deletions

View File

@ -111,9 +111,6 @@ export function edit_ingredient_and_close_modal(){
modal_el.close();
}
export function show_keys(event){
console.log(event.ctrlKey, event.key)
}
</script>
<style>

View File

@ -122,7 +122,6 @@
const item = await res.json();
}
async function doAdd () {
console.log(add_info.total_time)
const res = await fetch('/api/add', {
method: 'POST',
body: JSON.stringify({

View File

@ -14,7 +14,6 @@ const link_els = document.querySelectorAll("nav a")
link_els.forEach((el) => {
el.addEventListener("click", () => {toggle_sidebar(true)});
})
console.log(link_els)
})
</script>

View File

@ -229,7 +229,7 @@ span
<button class:selected={multiplier==1.5} on:click={() => {multiplier=1.5; custom_mul="…"}}><sup>3</sup>&frasl;<sub>2</sub>x</button>
<button class:selected={multiplier==2} on:click="{() => {multiplier=2; custom_mul="…"}}">2x</button>
<button class:selected={multiplier==3} on:click="{() => {multiplier=3; custom_mul="…"}}">3x</button>
<button class:selected={multiplier==custom_mul} on:click={(e) => { console.log(e) ;const el = e.composedPath()[0].children[0]; if(el){ el.focus()}}}>
<button class:selected={multiplier==custom_mul} on:click={(e) => { const el = e.composedPath()[0].children[0]; if(el){ el.focus()}}}>
<span class:selected={multiplier==custom_mul}
on:focus={() => { custom_mul="" }
}

View File

@ -47,7 +47,6 @@
const json = await res.json()
result = JSON.stringify(json)
console.log(result)
}
</script>
<style>

View File

@ -5,7 +5,6 @@
let months = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]
let month : number;
export let active_index;
console.log(active_index)
</script>
<style>

View File

@ -5,9 +5,8 @@ import { error } from "@sveltejs/kit";
import { dbConnect, dbDisconnect } from "../../utils/db";
import { User } from "../../models/User";;
export async function authenticateUser(event: RequestEvent){
export async function authenticateUser(cookies){
// Set your master secret key (replace with your own secret)
const { cookies } = event;
const masterSecret = COOKIE_SECRET;
const secretKey = masterSecret
let decoded
@ -19,7 +18,7 @@ export async function authenticateUser(event: RequestEvent){
}
catch(e){
throw error(401, "Cookies have changed, please log in again")
return null
}
if(decoded){