1
0
Fork 0

v2022.9.2 expects a json response when registering

Dieser Commit ist enthalten in:
Stefan Melmuk 2022-10-06 21:26:49 +02:00 committet von Daniel García
Ursprung 2d7ffbf378
Commit 1704d14f29
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: FC8A7D14C3CD543A

Datei anzeigen

@ -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")]