summaryrefslogtreecommitdiff
path: root/src/api/auth
diff options
context:
space:
mode:
authorpennae <github@quasiparticle.net>2022-07-17 17:22:56 +0200
committerpennae <github@quasiparticle.net>2022-07-17 17:22:56 +0200
commitc732402c21a6b2459588ff0c9633854a4b6b47f7 (patch)
treedef33d9491d1920b5780fc7646e174fca1072b41 /src/api/auth
parentb64981efd78f3ebecb327188a1ab168921c1698f (diff)
downloadminor-skulk-c732402c21a6b2459588ff0c9633854a4b6b47f7.tar.gz
minor-skulk-c732402c21a6b2459588ff0c9633854a4b6b47f7.tar.xz
minor-skulk-c732402c21a6b2459588ff0c9633854a4b6b47f7.zip
fix clippy warnings
Diffstat (limited to 'src/api/auth')
-rw-r--r--src/api/auth/invite.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/auth/invite.rs b/src/api/auth/invite.rs
index dd81540..f2c6ad8 100644
--- a/src/api/auth/invite.rs
+++ b/src/api/auth/invite.rs
@@ -14,8 +14,8 @@ pub(crate) async fn generate_invite_link(
) -> anyhow::Result<Reference<'static>> {
let code = base64::encode_config(&SecretBytes::<32>::generate().0, URL_SAFE_NO_PAD);
db.add_invite_code(&code, Utc::now() + ttl).await?;
- Ok(Reference::parse_owned(format!("{}/#/register/{}", cfg.location, code))
- .map_err(|e| anyhow!("url building failed at {e}"))?)
+ Reference::parse_owned(format!("{}/#/register/{}", cfg.location, code))
+ .map_err(|e| anyhow!("url building failed at {e}"))
}
#[derive(Debug, Deserialize)]
@@ -42,6 +42,6 @@ pub(crate) async fn generate(
if user.email != cfg.invite_admin_address {
return Err(auth::Error::InvalidAuthToken);
}
- let url = generate_invite_link(&db, &cfg, Duration::hours(req.body.ttl_hours as i64)).await?;
+ let url = generate_invite_link(db, cfg, Duration::hours(req.body.ttl_hours as i64)).await?;
Ok(Json(GenerateResp { url }))
}