feat(auth): enhance error handling for token expiration and unauthorized access
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user