vw_small

Hardened fork of Vaultwarden (https://github.com/dani-garcia/vaultwarden) with fewer features.
git clone https://git.philomathiclife.com/repos/vw_small
Log | Files | Refs | README

commit 1704d14f29c485f90cd6b9c4f06109dd259c6685
parent 2d7ffbf378350872bc38970b4cf9105ee99038b1
Author: Stefan Melmuk <stefan.melmuk@gmail.com>
Date:   Thu,  6 Oct 2022 21:26:49 +0200

v2022.9.2 expects a json response when registering

Diffstat:
Msrc/api/core/accounts.rs | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/api/core/accounts.rs b/src/api/core/accounts.rs @@ -81,7 +81,7 @@ fn enforce_password_hint_setting(password_hint: &Option<String>) -> EmptyResult } #[post("/accounts/register", data = "<data>")] -async fn register(data: JsonUpcase<RegisterData>, conn: DbConn) -> EmptyResult { +async fn register(data: JsonUpcase<RegisterData>, conn: DbConn) -> JsonResult { let data: RegisterData = data.into_inner().data; let email = data.Email.to_lowercase(); @@ -178,7 +178,10 @@ async fn register(data: JsonUpcase<RegisterData>, conn: DbConn) -> EmptyResult { } } - user.save(&conn).await + user.save(&conn).await?; + Ok(Json(json!({ + "registration": "success", + }))) } #[get("/accounts/profile")]