Skip to content

Commit e7c2b13

Browse files
committed
🐛 fix htpasswd user cannot pull normal images in bucket
1 parent 055cfc1 commit e7c2b13

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/handlers.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use tracing::{debug, error, info, warn};
88

99
use crate::{
1010
auth::{generate_token, parse_basic_auth, verify_password},
11-
models::AuthRequest,
11+
models::{AuthRequest, UserSource},
1212
registry::proxy_request,
1313
AppState,
1414
};
@@ -263,7 +263,7 @@ pub async fn auth_handler(
263263
// Check if user is admin of the specified game scope
264264
match state.database.get_game_by_namespace(namespace).await {
265265
Ok(Some(game)) => {
266-
if !game.is_admin(user.id) {
266+
if user.source == UserSource::Database && !game.is_admin(user.id) {
267267
warn!(
268268
"User '{}' is not admin of game {}: {}",
269269
username, game.id, game.bucket

0 commit comments

Comments
 (0)