Implement logout, renaming sessions::Cookie to sessions::Sesssion

This commit is contained in:
selfhoster selfhoster 2023-08-25 10:16:59 +00:00
commit 70b417865f
4 changed files with 178 additions and 37 deletions

View file

@ -8,12 +8,14 @@ use crate::state::RoutableAppState;
mod index;
mod login;
mod logout;
/// Build a router for the application, in a specific subpath eg `/yunohost/sso/`
pub fn router(subpath: Option<String>, state: RoutableAppState) -> Router {
let app = Router::new()
.route("/", get(index::route))
.route("/login/", post(login::route))
.route("/logout/", get(logout::route))
.layer(CookieManagerLayer::new())
.with_state(state);
if let Some(p) = subpath {