Skip to content

Commit 964cdfd

Browse files
authored
fix: ensure decoding of UserPublic.identifier is optional [#256] (#257)
1 parent 6ebb212 commit 964cdfd

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

packages/clerk_auth/lib/src/models/client/user_public.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class UserPublic with InformativeToStringMixin {
1919
});
2020

2121
/// identifier
22-
final String identifier;
22+
final String? identifier;
2323

2424
/// first name
2525
final String? firstName;

packages/clerk_auth/lib/src/models/client/user_public.g.dart

Lines changed: 3 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/clerk_auth/test/integration/clerk_api/sign_in_test.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void main() {
6767
expect(client?.signIn, null);
6868
expect(client?.activeSession?.status, Status.active);
6969
expect(
70-
client?.activeSession?.publicUserData.identifier.isNotEmpty, true);
70+
client?.activeSession?.publicUserData.identifier?.isNotEmpty, true);
7171
});
7272
});
7373

@@ -114,7 +114,7 @@ void main() {
114114
expect(client?.signIn, null);
115115
expect(client?.activeSession?.status, Status.active);
116116
expect(
117-
client?.activeSession?.publicUserData.identifier.isNotEmpty, true);
117+
client?.activeSession?.publicUserData.identifier?.isNotEmpty, true);
118118
});
119119
});
120120

@@ -198,7 +198,7 @@ void main() {
198198
expect(client?.signIn, null);
199199
expect(client?.activeSession?.status, Status.active);
200200
expect(
201-
client?.activeSession?.publicUserData.identifier.isNotEmpty, true);
201+
client?.activeSession?.publicUserData.identifier?.isNotEmpty, true);
202202
});
203203
});
204204
});

packages/clerk_auth/test/integration/clerk_api/sign_up_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void main() {
9797
expect(client?.signUp, null);
9898
expect(client?.activeSession?.status, Status.active);
9999
expect(
100-
client?.activeSession?.publicUserData.identifier.isNotEmpty, true);
100+
client?.activeSession?.publicUserData.identifier?.isNotEmpty, true);
101101
});
102102
});
103103

@@ -144,7 +144,7 @@ void main() {
144144
expect(client?.signUp, null);
145145
expect(client?.activeSession?.status, Status.active);
146146
expect(
147-
client?.activeSession?.publicUserData.identifier.isNotEmpty, true);
147+
client?.activeSession?.publicUserData.identifier?.isNotEmpty, true);
148148
});
149149
});
150150
});

0 commit comments

Comments
 (0)