feat(auth): enhance error handling for token expiration and unauthorized access

This commit is contained in:
2026-03-14 03:00:30 +01:00
parent 791741fde0
commit c189056003
4 changed files with 41 additions and 23 deletions

View File

@@ -55,6 +55,10 @@ pub(super) fn check_access(
match mode {
AccessMode::Public => Ok(()),
AccessMode::PasswordProtected => {
// Owner always has access to their own channel without needing the password
if user.map(|u| u.id) == Some(owner_id) {
return Ok(());
}
let hash = password_hash.ok_or(ApiError::PasswordRequired)?;
let supplied = supplied_password.unwrap_or("").trim();
if supplied.is_empty() {