slight ui/ux fixes and updates to auth protocol

This commit is contained in:
DecDuck
2024-10-12 17:44:23 +11:00
parent e828bca2a5
commit 8a2d23df26
4 changed files with 26 additions and 8 deletions

View File

@ -10,12 +10,18 @@
</NuxtLink>
<nav class="inline-flex items-center mt-0.5">
<ol class="inline-flex items-center gap-x-6">
<li
class="transition text-zinc-300 hover:text-zinc-100 uppercase font-display font-semibold text-md"
<NuxtLink
v-for="(nav, navIdx) in navigation"
:class="[
'transition uppercase font-display font-semibold text-md',
navIdx === currentPageIndex
? 'text-zinc-100'
: 'text-zinc-400 hover:text-zinc-200',
]"
:href="nav.route"
>
{{ nav.label }}
</li>
</NuxtLink>
</ol>
</nav>
</div>
@ -68,6 +74,8 @@ const navigation: Array<NavigationItem> = [
},
];
const currentPageIndex = useCurrentNavigationIndex(navigation);
const quickActions: Array<QuickActionNav> = [
{
icon: UserGroupIcon,

View File

@ -1,5 +1,6 @@
<template>{{state}}</template>
<template />
<script setup lang="ts">
const state = useAppState();
</script>
const router = useRouter();
router.replace("/store");
</script>

3
pages/store/index.vue Normal file
View File

@ -0,0 +1,3 @@
<template>
</template>

View File

@ -1,8 +1,9 @@
use core::time;
use std::{
borrow::{Borrow, BorrowMut},
env,
fmt::format,
sync::Mutex,
sync::Mutex, time::{SystemTime, UNIX_EPOCH},
};
use log::{info, warn};
@ -69,7 +70,12 @@ pub fn generate_authorization_header() -> String {
db.auth.clone().unwrap()
};
let nonce = Uuid::new_v4().to_string();
let start = SystemTime::now();
let timestamp = start
.duration_since(UNIX_EPOCH)
.expect("Time went backwards");
let nonce = timestamp.as_millis().to_string();
let signature = sign_nonce(certs.private, nonce.clone()).unwrap();
return format!("Nonce {} {} {}", certs.clientId, nonce, signature);