mirror of
https://github.com/Suwayomi/Tachidesk.git
synced 2025-12-21 03:52:34 +01: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 {
|
fun getUserFromToken(token: String?): UserType {
|
||||||
|
if (serverConfig.authMode.value != AuthMode.UI_LOGIN) {
|
||||||
|
return UserType.Admin(1)
|
||||||
|
}
|
||||||
|
|
||||||
if (token.isNullOrBlank()) {
|
if (token.isNullOrBlank()) {
|
||||||
return UserType.Visitor
|
return UserType.Visitor
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user