fix: redirect user to challenge instructions page after challenge addition

This commit is contained in:
Aravinth Manivannan 2022-05-19 19:31:17 +05:30
parent 2785d04f03
commit c7d7f9ec8a

View file

@ -120,12 +120,14 @@ pub async fn add_submit(
} }
} }
_add_submit(&payload, &ctx, &db) let challenge = _add_submit(&payload, &ctx, &db)
.await .await
.map_err(|e| PageError::new(AddChallenge::new(&ctx.settings, Some(&payload)), e))?; .map_err(|e| PageError::new(AddChallenge::new(&ctx.settings, Some(&payload)), e))?;
let link = PAGES.auth.verify_get(&challenge.key);
Ok(HttpResponse::Found() Ok(HttpResponse::Found()
.insert_header((http::header::LOCATION, PAGES.auth.add)) .insert_header((http::header::LOCATION, link))
.finish()) .finish())
} }