diff options
author | pennae <github@quasiparticle.net> | 2022-07-17 13:21:16 +0200 |
---|---|---|
committer | pennae <github@quasiparticle.net> | 2022-07-17 17:25:48 +0200 |
commit | 5d7f509f1a98c2d45870e3877b4d7bfa756d2d2a (patch) | |
tree | 10da9b0614c5f1f98d4edc82e96a798e25971bc0 /src/api/auth/oauth.rs | |
parent | 55343df9c1f54113b5f2ed04cecfadf0670887c7 (diff) | |
download | minor-skulk-5d7f509f1a98c2d45870e3877b4d7bfa756d2d2a.tar.gz minor-skulk-5d7f509f1a98c2d45870e3877b4d7bfa756d2d2a.tar.xz minor-skulk-5d7f509f1a98c2d45870e3877b4d7bfa756d2d2a.zip |
use HawkKey everywhere hawk keys are handled
the db already does this, crypto did not.
Diffstat (limited to 'src/api/auth/oauth.rs')
-rw-r--r-- | src/api/auth/oauth.rs | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/api/auth/oauth.rs b/src/api/auth/oauth.rs index c159352..28d9fb2 100644 --- a/src/api/auth/oauth.rs +++ b/src/api/auth/oauth.rs @@ -17,7 +17,7 @@ use crate::{ auth::Authenticated, crypto::SessionCredentials, types::{ - HawkKey, OauthAccessToken, OauthAccessType, OauthAuthorization, OauthAuthorizationID, + OauthAccessToken, OauthAccessType, OauthAuthorization, OauthAuthorizationID, OauthRefreshToken, OauthToken, OauthTokenID, SessionID, UserID, }, }; @@ -394,14 +394,8 @@ 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, - HawkKey(session.req_hmac_key.0), - true, - None, - ) - .await?; + db.add_session(session.token_id.clone(), &user_id, session.req_hmac_key, true, None) + .await?; (Some(session_token), Some(session.token_id)) } else { (None, None) |