actually add fingerprint to manage mail template
This commit is contained in:
parent
ad19bd01d9
commit
bc3adcb610
|
@ -22,6 +22,7 @@ mod context {
|
|||
|
||||
#[derive(Serialize, Clone)]
|
||||
pub struct Manage {
|
||||
pub primary_fp: String,
|
||||
pub uri: String,
|
||||
pub base_uri: String,
|
||||
pub domain: String,
|
||||
|
@ -90,9 +91,10 @@ impl Service {
|
|||
)
|
||||
}
|
||||
|
||||
pub fn send_manage_token(&self, recipient: &Email, link_path: &str)
|
||||
-> Result<()> {
|
||||
pub fn send_manage_token(&self, tpk_name: String, recipient: &Email,
|
||||
link_path: &str) -> Result<()> {
|
||||
let ctx = context::Manage {
|
||||
primary_fp: tpk_name,
|
||||
uri: format!("{}{}", self.base_uri, link_path),
|
||||
base_uri: self.base_uri.clone(),
|
||||
domain: self.domain.clone(),
|
||||
|
|
|
@ -147,10 +147,11 @@ pub fn vks_manage_post(
|
|||
}
|
||||
|
||||
let fpr: Fingerprint = tpk.fingerprint().try_into().unwrap();
|
||||
let fpr_text = fpr.to_string();
|
||||
let token = token_service.create(&StatelessVerifyToken { fpr });
|
||||
let link_path = uri!(vks_manage_key: token).to_string();
|
||||
|
||||
if let Err(e) = mail_service.send_manage_token(&email, &link_path) {
|
||||
if let Err(e) = mail_service.send_manage_token(fpr_text, &email, &link_path) {
|
||||
return MyResponse::ise(e);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue