mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 09:24:34 -05:00
GraphQL directly uses getUserFromToken and expects a valid user for (#1616)
other authentication methods, so re-introduce that check
This commit is contained in:
@@ -34,6 +34,10 @@ fun UserType.requireUserWithBasicFallback(ctx: Context): Int =
|
||||
}
|
||||
|
||||
fun getUserFromToken(token: String?): UserType {
|
||||
if (serverConfig.authMode.value != AuthMode.UI_LOGIN) {
|
||||
return UserType.Admin(1)
|
||||
}
|
||||
|
||||
if (token.isNullOrBlank()) {
|
||||
return UserType.Visitor
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user