mirror of
				https://github.com/dani-garcia/vaultwarden.git
				synced 2025-10-31 18:28:20 +02:00 
			
		
		
		
	Fix Vaultwarden Admin page error messages (#4869)
Since the change to camelCase variables the error messages in the Vaultwarden Admin were not shown correctly anymore. This PR fixes this by changing the case of the json key's. Also updated the save and delete of the config to provide a more descriptive error instead of only `Io` or which ever other error might occure. Fixes #4834
This commit is contained in:
		
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			
						parent
						
							3466a8040e
						
					
				
				
					commit
					669b9db758
				
			| @@ -750,12 +750,18 @@ fn get_diagnostics_config(_token: AdminToken) -> Json<Value> { | ||||
| #[post("/config", data = "<data>")] | ||||
| fn post_config(data: Json<ConfigBuilder>, _token: AdminToken) -> EmptyResult { | ||||
|     let data: ConfigBuilder = data.into_inner(); | ||||
|     CONFIG.update_config(data) | ||||
|     if let Err(e) = CONFIG.update_config(data) { | ||||
|         err!(format!("Unable to save config: {e:?}")) | ||||
|     } | ||||
|     Ok(()) | ||||
| } | ||||
|  | ||||
| #[post("/config/delete")] | ||||
| fn delete_config(_token: AdminToken) -> EmptyResult { | ||||
|     CONFIG.delete_user_config() | ||||
|     if let Err(e) = CONFIG.delete_user_config() { | ||||
|         err!(format!("Unable to delete config: {e:?}")) | ||||
|     } | ||||
|     Ok(()) | ||||
| } | ||||
|  | ||||
| #[post("/config/backup_db")] | ||||
|   | ||||
		Reference in New Issue
	
	Block a user