Hi!
We are facing an issue when users log in and connect to sendbird server. Afterwards, trying to load the list of available channels we get the following message Not authorized. "Session-Key doesn’t match user_id
Any idea why can this happen?
Also, is there a way I can refresh this session key?
Thanks!
Woo
October 15, 2021, 6:20pm
2
Hello @Juan_Jose_Sebastian thank you for your patient. Would you share some code snippet and/or screen shot so we can debug what exactly happen.
1 Like
Hi Woo,
To init sendbird in main.dart
`void _sendBirdInit() { try { _sendBird = SendbirdSdk(appId: Flavor.sendbird); _sendBird.addChannelEventHandler("channel_list_view_shopper", this); } catch (err) { debugPrint("SENDBIRD_INIT: $err"); } }`
To connect user when login is success
`Future<void> connectUserToSendBirdServer( {UserModel user, TokensModel token}) async { try { await _sendBird.connect(user?.user?.email); await _sendBird.updateCurrentUserInfo( nickname: "${user?.user?.firstName ?? ""} ${user?.user?.lastName ?? ""}", fileInfo: FileInfo.fromUrl(mimeType: "image/jpeg", url: user?.picture ?? ""), ); } catch (err) { RegularException(where: "CONNECT_USER", message: "${err.message}"); } }`
After this, get the list of channels
`Future<void> loadChannelList() async { try { query = GroupChannelListQuery() ..order = GroupChannelListOrder.latestLastMessage _groupChannels = await query.loadNext(); notifyListeners(); } catch (err) { throw RegularException(where: 'LOAD_CHANNEL_LISTS', message: err.message); } }`
Although I get this error message: → Not authorized. "Session-Key doesn’t match user_id
Woo
October 15, 2021, 8:37pm
4
would you be able to create a project to reproduce your issue? I can’t think of any issue nor I can reproduce on sample.