GraphQL directly uses getUserFromToken and expects a valid user for (#1616)

other authentication methods, so re-introduce that check
This commit is contained in:
Constantin Piber
2025-08-25 12:02:12 +02:00
committed by GitHub
parent 46e2ef125a
commit 04ad0033d7

View File

@@ -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
}