update to support user expire, timeout, and disconnect
This commit is contained in:
parent
fe65835f4a
commit
5fcd49e847
16 changed files with 744 additions and 238 deletions
|
|
@ -12,6 +12,9 @@ use std::sync::Arc;
|
|||
#[cfg(feature = "ssr")]
|
||||
use crate::api::WebSocketState;
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
use chattyness_shared::WebSocketConfig;
|
||||
|
||||
/// Application state for the public app.
|
||||
#[cfg(feature = "ssr")]
|
||||
#[derive(Clone)]
|
||||
|
|
@ -19,6 +22,7 @@ pub struct AppState {
|
|||
pub pool: sqlx::PgPool,
|
||||
pub leptos_options: LeptosOptions,
|
||||
pub ws_state: Arc<WebSocketState>,
|
||||
pub ws_config: WebSocketConfig,
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
|
|
@ -42,6 +46,13 @@ impl axum::extract::FromRef<AppState> for Arc<WebSocketState> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "ssr")]
|
||||
impl axum::extract::FromRef<AppState> for WebSocketConfig {
|
||||
fn from_ref(state: &AppState) -> Self {
|
||||
state.ws_config.clone()
|
||||
}
|
||||
}
|
||||
|
||||
/// Shell component for SSR.
|
||||
pub fn shell(options: LeptosOptions) -> impl IntoView {
|
||||
view! {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue