fix: SEC16

This commit is contained in:
timedout committed 2026-06-20 16:03:37 +01:00
1 parent 1ba90deeba
commit 62b58e1a6a
3 files changed
+11

No files matched your search

+6
View File
@@ -162,6 +162,9 @@ impl CheckAuth for AccessToken {
query: AuthQueryParams,
route: TypeId,
) -> Result<Self::Identity> {
if output.is_empty() {
return Err!(Request(Unauthorized("Missing access token.")));
}
if let Ok((sender_user, sender_device)) = services.users.find_from_token(&output).await {
// Locked users can only use /logout and /logout/all
if services
@@ -259,6 +262,9 @@ impl CheckAuth for AppserviceToken {
_query: AuthQueryParams,
_route: TypeId,
) -> Result<Self::Identity> {
if output.is_empty() {
return Err!(Request(Unauthorized("Missing access token.")));
}
let Ok(appservice_info) = services.appservice.find_from_token(&output).await else {
return Err!(Request(Unauthorized("Invalid appservice token.")));
};