JWT Authentication

This commit is contained in:
Michael Mikovsky
2025-11-29 13:15:09 -07:00
parent fcb8c6f6f5
commit a10bdce38f
18 changed files with 1198 additions and 583 deletions
+6 -4
View File
@@ -3,12 +3,14 @@ mod windows;
use std::collections::HashMap;
use crate::{app::windows::WindowWrapper, config::Config, flowchart::FlowChart};
use crate::{app::windows::WindowWrapper, auth::Auth, config::Config, flowchart::FlowChart};
pub use app::TemplateApp;
use egui_tiles::{TileId, Tree};
#[derive(Default, serde::Deserialize, serde::Serialize)]
struct AppState {
pub struct AppState {
pub auth: Auth,
pub open_windows: HashMap<AppWindow, TileId>,
pub flowchart: FlowChart,
@@ -64,7 +66,7 @@ impl AppState {
}
#[derive(Clone, Copy, serde::Deserialize, serde::Serialize, PartialEq, Eq, Hash)]
enum AppWindow {
pub enum AppWindow {
Flowchart,
Config,
}
@@ -73,7 +75,7 @@ impl AppWindow {
fn update(&self, state: &mut AppState, ui: &mut egui::Ui) {
match self {
AppWindow::Flowchart => state.flowchart.paint(ui),
AppWindow::Config => state.config.update(ui),
AppWindow::Config => state.config.update(&mut state.auth, ui),
}
}
}