mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-04 03:14:40 -05:00
Handle missing credentials as being invalid (#1164)
In case the credentials were missing the basic authentication was just bypassed
This commit is contained in:
@@ -108,7 +108,7 @@ object JavalinSetup {
|
|||||||
|
|
||||||
app.beforeMatched { ctx ->
|
app.beforeMatched { ctx ->
|
||||||
fun credentialsValid(): Boolean {
|
fun credentialsValid(): Boolean {
|
||||||
val basicAuthCredentials = ctx.basicAuthCredentials() ?: return true
|
val basicAuthCredentials = ctx.basicAuthCredentials() ?: return false
|
||||||
val (username, password) = basicAuthCredentials
|
val (username, password) = basicAuthCredentials
|
||||||
return username == serverConfig.basicAuthUsername.value &&
|
return username == serverConfig.basicAuthUsername.value &&
|
||||||
password == serverConfig.basicAuthPassword.value
|
password == serverConfig.basicAuthPassword.value
|
||||||
|
|||||||
Reference in New Issue
Block a user