From b5060b26f60eb403e6885676e6a68546063b304c Mon Sep 17 00:00:00 2001 From: Omkar Todkar Date: Wed, 29 Sep 2021 02:50:38 +0530 Subject: [PATCH] support for int userId in tokens --- packages/stream_chat/lib/src/core/http/token.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stream_chat/lib/src/core/http/token.dart b/packages/stream_chat/lib/src/core/http/token.dart index 7d746286..0830aa68 100644 --- a/packages/stream_chat/lib/src/core/http/token.dart +++ b/packages/stream_chat/lib/src/core/http/token.dart @@ -46,12 +46,12 @@ class Token extends Equatable { /// Creates a [Token] instance from the provided [rawValue] if it's valid. factory Token.fromRawValue(String rawValue) { final jwtBody = JsonWebToken.unverified(rawValue); - final userId = jwtBody.claims.getTyped('user_id'); + final userId = jwtBody.claims.getTyped('user_id'); assert( userId != null, 'Invalid `token`, It should contain `user_id`', ); - return Token._(rawValue: rawValue, userId: userId!, authType: AuthType.jwt); + return Token._(rawValue: rawValue, userId: userId!.toString(), authType: AuthType.jwt); } /// The token which can be used during the development.