From c7d7f9ec8ab050bec8b25f14157d03b97e69bee2 Mon Sep 17 00:00:00 2001 From: realaravinth Date: Thu, 19 May 2022 19:31:17 +0530 Subject: [PATCH] fix: redirect user to challenge instructions page after challenge addition --- src/pages/auth/add.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/auth/add.rs b/src/pages/auth/add.rs index 143b7e0..5287531 100644 --- a/src/pages/auth/add.rs +++ b/src/pages/auth/add.rs @@ -120,12 +120,14 @@ pub async fn add_submit( } } - _add_submit(&payload, &ctx, &db) + let challenge = _add_submit(&payload, &ctx, &db) .await .map_err(|e| PageError::new(AddChallenge::new(&ctx.settings, Some(&payload)), e))?; + let link = PAGES.auth.verify_get(&challenge.key); + Ok(HttpResponse::Found() - .insert_header((http::header::LOCATION, PAGES.auth.add)) + .insert_header((http::header::LOCATION, link)) .finish()) }