1
0

Make get_user_from_headers and check_is_moderator_from_headers take in a bitflag of Scopes rather than a slice of Scopes (#3765)

This commit is contained in:
Josiah Glosson
2025-06-09 14:29:32 -05:00
committed by GitHub
parent 06f1df1995
commit 3afb682fc6
28 changed files with 161 additions and 157 deletions

View File

@@ -141,7 +141,7 @@ pub async fn list(
&**pool,
&redis,
&session_queue,
Some(&[Scopes::SESSION_READ]),
Scopes::SESSION_READ,
)
.await?
.1;
@@ -178,7 +178,7 @@ pub async fn delete(
&**pool,
&redis,
&session_queue,
Some(&[Scopes::SESSION_DELETE]),
Scopes::SESSION_DELETE,
)
.await?
.1;
@@ -212,10 +212,15 @@ pub async fn refresh(
redis: Data<RedisPool>,
session_queue: Data<AuthQueue>,
) -> Result<HttpResponse, ApiError> {
let current_user =
get_user_from_headers(&req, &**pool, &redis, &session_queue, None)
.await?
.1;
let current_user = get_user_from_headers(
&req,
&**pool,
&redis,
&session_queue,
Scopes::empty(),
)
.await?
.1;
let session = req
.headers()
.get(AUTHORIZATION)