Fix websocket token (#1766)

This commit is contained in:
Mitchell Syer
2025-11-06 15:26:04 -05:00
committed by GitHub
parent bb09c558b6
commit 0f95e19c76
3 changed files with 18 additions and 4 deletions

View File

@@ -155,7 +155,10 @@ class ApolloSubscriptionProtocolHandler(
): Flow<SubscriptionOperationMessage> {
@Suppress("UNCHECKED_CAST")
val user =
context.getAttributeOrSet(Attribute.TachideskUser) {
context.getAttributeOrSet(
Attribute.TachideskUser,
replaceIf = { it == UserType.Visitor },
) {
val payload = operationMessage.payload as? Map<String, Any?>
val token = payload?.let { it[Header.AUTHORIZATION] as? String }
getUserFromToken(token)