Skip to content

Commit

Permalink
Handle missing credentials as being invalid (#1164)
Browse files Browse the repository at this point in the history
In case the credentials were missing the basic authentication was just bypassed
  • Loading branch information
schroda authored Nov 23, 2024
1 parent fb51834 commit 38673bb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ object JavalinSetup {

app.beforeMatched { ctx ->
fun credentialsValid(): Boolean {
val basicAuthCredentials = ctx.basicAuthCredentials() ?: return true
val basicAuthCredentials = ctx.basicAuthCredentials() ?: return false
val (username, password) = basicAuthCredentials
return username == serverConfig.basicAuthUsername.value &&
password == serverConfig.basicAuthPassword.value
Expand Down

0 comments on commit 38673bb

Please sign in to comment.