add(ui): ability to log out
This commit is contained in:
parent
d2ca9e23d3
commit
b3cac5f97a
29 changed files with 499 additions and 124 deletions
|
@ -55,7 +55,7 @@ macro_rules! create_dir_if_not_exists {
|
|||
|
||||
#[macro_export]
|
||||
macro_rules! get_user_from_token {
|
||||
(($jar:ident, $db:expr) <optional>) => {{
|
||||
($jar:ident, $db:expr) => {{
|
||||
if let Some(token) = $jar.get("__Secure-atto-token") {
|
||||
match $db
|
||||
.get_user_by_token(&tetratto_shared::hash::hash(
|
||||
|
@ -70,17 +70,6 @@ macro_rules! get_user_from_token {
|
|||
None
|
||||
}
|
||||
}};
|
||||
|
||||
($jar:ident, $db:ident) => {{
|
||||
if let Some(token) = $jar.get("__Secure-Atto-Token") {
|
||||
match $db.get_user_by_token(token) {
|
||||
Ok(ua) => ua,
|
||||
Err(_) => return axum::response::Html(crate::data::assets::REDIRECT_TO_AUTH),
|
||||
}
|
||||
} else {
|
||||
None
|
||||
}
|
||||
}};
|
||||
}
|
||||
|
||||
#[macro_export]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue