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

@@ -16,7 +16,7 @@ use oidc::{route_get_oidc, route_get_oidc_callback};
use routes::{
addressbook::{route_addressbook, route_addressbook_restore},
calendar::{route_calendar, route_calendar_restore},
login::{route_get_login, route_post_login},
login::{route_get_login, route_post_login, route_post_logout},
};
use rustical_store::{
Addressbook, AddressbookStore, Calendar, CalendarStore,
@@ -162,6 +162,11 @@ pub fn configure_frontend<AP: AuthenticationProvider, CS: CalendarStore, AS: Add
.route(web::method(Method::GET).to(route_get_login))
.route(web::method(Method::POST).to(route_post_login::<AP>)),
)
.service(
web::resource("/logout")
.name("frontend_logout")
.route(web::method(Method::POST).to(route_post_logout)),
)
.service(
web::resource("/login/oidc")
.name("frontend_login_oidc")