Needs a lot of work
This commit is contained in:
@@ -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(),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user