frontend: Add button to log out

This commit is contained in:
Lennart
2025-04-13 15:49:27 +02:00
parent 0c5002f357
commit fe0bab00f6
3 changed files with 14 additions and 1 deletions

View File

@@ -54,3 +54,8 @@ pub async fn route_post_login<AP: AuthenticationProvider>(
ErrorUnauthorized("Unauthorized").error_response()
}
}
pub async fn route_post_logout(req: HttpRequest, session: Session) -> Redirect {
session.remove("user");
Redirect::to(req.url_for_static("frontend_login").unwrap().to_string()).see_other()
}