Skip to content

Commit

Permalink
Cookies
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesTaylor7 committed May 27, 2024
1 parent d8c60e3 commit 67cc2e3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/markup/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::env;
use tower_cookies::Cookies;

pub fn page(cookies: &Cookies, main: Markup) -> Markup {
let logged_in = cookies.get("refresh_token").is_some();
html! {
(DOCTYPE)
html
Expand Down Expand Up @@ -32,14 +31,17 @@ pub fn page(cookies: &Cookies, main: Markup) -> Markup {
data-theme="dark"
_="init get the theme of localStorage if it exists set my @data-theme to it"
hx-swap="morph" hx-target="body" {
(nav(logged_in))
(nav(cookies))
(main)
}
}
}
}

fn nav(logged_in: bool) -> Markup {
fn nav(cookies: &Cookies) -> Markup {
let logged_in = cookies.get("refresh_token").is_some();
// let impersonation =

//let dev = cfg!(feature = "dev");
html! {
div class="flex flex-row justify-end items-center" {
Expand Down

0 comments on commit 67cc2e3

Please sign in to comment.