We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dd20906 commit 82c90e6Copy full SHA for 82c90e6
packages/powersync/lib/src/connector.dart
@@ -113,7 +113,12 @@ class PowerSyncCredentials {
113
try {
114
List<String> parts = token.split('.');
115
if (parts.length == 3) {
116
- final rawData = base64Decode(parts[1]);
+ String part = parts[1];
117
+ // dart:convert doesn't like missing padding
118
+ if (part.length % 4 > 0) {
119
+ part += '=' * (4 - part.length % 4);
120
+ }
121
+ final rawData = base64Decode(part);
122
final text = Utf8Decoder().convert(rawData);
123
Map<String, dynamic> payload = jsonDecode(text);
124
if (payload.containsKey('exp') && payload['exp'] is int) {
0 commit comments