From eefb5bbf6ec56000f6dbe85ec6ab38b6e309145b Mon Sep 17 00:00:00 2001 From: dshukertjr Date: Tue, 17 Dec 2024 00:53:21 +0900 Subject: [PATCH] properly parse JWT within realtime client --- packages/realtime_client/lib/src/realtime_client.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/realtime_client/lib/src/realtime_client.dart b/packages/realtime_client/lib/src/realtime_client.dart index 18307f5f..3ecfb612 100644 --- a/packages/realtime_client/lib/src/realtime_client.dart +++ b/packages/realtime_client/lib/src/realtime_client.dart @@ -415,8 +415,8 @@ class RealtimeClient { Map? parsed; try { final decoded = - utf8.decode(base64Url.decode(tokenToSend.split('.')[1])); - parsed = json.decode(decoded); + base64.decode(base64.normalize(tokenToSend.split('.')[1])); + parsed = json.decode(utf8.decode(decoded)); } catch (e) { // ignore parsing errors }