From 3eda99e9efbdfc2cb0e20932f20018d53baf5a64 Mon Sep 17 00:00:00 2001 From: pennae Date: Sun, 17 Jul 2022 17:32:54 +0200 Subject: make the Clone bytes types Copy as well u8 arrays are copy, no need to not have our wrappers be copy. --- src/api/auth/oauth.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/api/auth/oauth.rs') diff --git a/src/api/auth/oauth.rs b/src/api/auth/oauth.rs index 28d9fb2..384d4b4 100644 --- a/src/api/auth/oauth.rs +++ b/src/api/auth/oauth.rs @@ -304,7 +304,7 @@ pub(crate) async fn token_authenticated( Some(req.context.created_at), req.body, None, - Some(req.session.clone()), + Some(req.session), ) .await } @@ -380,7 +380,7 @@ async fn token_impl( db.add_access_token( &access_token.hash(), OauthAccessToken { - user_id: user_id.clone(), + user_id, client_id: req.client_id.clone(), scope: scope.clone(), parent_refresh, @@ -394,8 +394,7 @@ async fn token_impl( let (session_token, session_id) = if scope.implies(&SESSION_SCOPE) { let session_token = SessionToken::generate(); let session = SessionCredentials::derive_from(&session_token); - db.add_session(session.token_id.clone(), &user_id, session.req_hmac_key, true, None) - .await?; + db.add_session(session.token_id, &user_id, session.req_hmac_key, true, None).await?; (Some(session_token), Some(session.token_id)) } else { (None, None) -- cgit v1.2.3