1
0
Fork 0
mirror of https://github.com/dani-garcia/vaultwarden.git synced 2025-09-01 23:44:47 +00:00

Show organizations in admin panel, implement reload templates option

This commit is contained in:
Daniel García 2019-01-20 17:43:56 +01:00
commit bfd93e5b13
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
5 changed files with 56 additions and 9 deletions

View file

@ -49,7 +49,7 @@ impl AdminTemplateData {
}
fn render(self) -> Result<String, Error> {
CONFIG.templates.render("admin/base", &self).map_err(Into::into)
CONFIG.render_template("admin/base", &self)
}
}
@ -72,6 +72,7 @@ struct LoginForm {
fn post_admin_login(data: Form<LoginForm>, mut cookies: Cookies, ip: ClientIp) -> Result<Redirect, Flash<Redirect>> {
let data = data.into_inner();
// If the token is invalid, redirect to login page
if !_validate_token(&data.token) {
error!("Invalid admin token. IP: {}", ip.ip);
Err(Flash::error(