Skip to content

Commit

Permalink
feat: add support for empty secret
Browse files Browse the repository at this point in the history
  • Loading branch information
lenisko committed Dec 11, 2023
1 parent a6449cd commit 0f18c82
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/api/src/utils/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ pub async fn public_validator(
if logged_in(&req) {
return Ok(req);
}
if env::var("KOJI_SECRET").unwrap_or("".to_string()).is_empty() {
return Ok(req);
}
if let Some(credentials) = credentials {
if credentials.token() == env::var("KOJI_SECRET").unwrap_or("".to_string()) {
return Ok(req);
Expand Down

0 comments on commit 0f18c82

Please sign in to comment.