fix: redirect user to challenge instructions page after challenge addition
This commit is contained in:
parent
2785d04f03
commit
c7d7f9ec8a
1 changed files with 4 additions and 2 deletions
|
@ -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())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue