1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-12-17 03:19:19 +00:00

Add reset user config button

This commit is contained in:
Daniel García 2019-02-06 17:32:13 +01:00
commit ef63342e20
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
3 changed files with 55 additions and 19 deletions

View file

@ -27,6 +27,7 @@ pub fn routes() -> Vec<Route> {
delete_user,
deauth_user,
post_config,
delete_config,
]
}
@ -173,6 +174,11 @@ fn post_config(data: Json<ConfigBuilder>, _token: AdminToken) -> EmptyResult {
CONFIG.update_config(data)
}
#[post("/config/delete")]
fn delete_config(_token: AdminToken) -> EmptyResult {
CONFIG.delete_user_config()
}
pub struct AdminToken {}
impl<'a, 'r> FromRequest<'a, 'r> for AdminToken {