Added basic logging in
Some checks failed
Build Crate / build (push) Failing after 54s

Needs a lot of work
This commit is contained in:
2024-08-26 00:09:08 -04:00
parent 99b4d9af1a
commit 0f20ba3b86
13 changed files with 174 additions and 45 deletions

View File

@@ -7,7 +7,6 @@ use web_sys::Event;
cfg_if::cfg_if! {
if #[cfg(client)] {
use crate::templates::global_state::AppStateRx;
use crate::endpoints::{MATCH, USER};
use crate::templates::get_api_path;
use chrono::Utc;
}
@@ -85,8 +84,8 @@ async fn get_request_state(
_req: Request,
) -> Result<PageState, BlamedError<std::convert::Infallible>> {
Ok(PageState {
winner: "Ferris".to_string(),
new_user: "newguy".to_string(),
winner: "Ferris".to_owned(),
new_user: "newguy".to_owned(),
})
}

View File

@@ -3,7 +3,10 @@
use perseus::{prelude::*, state::GlobalStateCreator};
use serde::{Deserialize, Serialize};
use crate::state_enums::{LoginState, OpenState};
use crate::{
models::auth::Claims,
state_enums::{LoginState, OpenState},
};
cfg_if::cfg_if! {
if #[cfg(engine)] {
@@ -34,10 +37,6 @@ pub struct ModalOpenData {
pub login: OpenState,
}
#[derive(Serialize, Deserialize, ReactiveState, Clone)]
#[rx(alias = "ClaimsRx")]
pub struct Claims {}
pub fn get_global_state_creator() -> GlobalStateCreator {
GlobalStateCreator::new().build_state_fn(get_build_state)
}
@@ -48,7 +47,10 @@ pub async fn get_build_state() -> AppState {
auth: AuthData {
state: LoginState::Unknown,
username: None,
claims: Claims {},
claims: Claims {
sub: "".to_owned(),
exp: 0,
},
},
modals_open: ModalOpenData {
login: OpenState::Closed,