Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when using client.devToken("userId").rawValue #2009

Open
1 task done
Ali-Farhoud opened this issue Aug 26, 2024 · 2 comments
Open
1 task done

Error when using client.devToken("userId").rawValue #2009

Ali-Farhoud opened this issue Aug 26, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@Ali-Farhoud
Copy link

Which packages are you using?

stream_chat_flutter

On what platforms did you experience the issue?

iOS

What version are you using?

stream_chat_flutter: ^8.0.0

What happened?

In a development environment, I am generating tokens dynamically for my user using client.devToken('userId').rawValue. like this : final token = client.devToken(currentUserId).rawValue; final connectionFuture = await client.connectUser( currentChatUser, token, );

This shows the following error on my terminal : flutter: WebSocketError(message: JWTAuth error: illegal base64 data at input byte 47, data: ErrorResponse(code: 5, message: JWTAuth error: illegal base64 data at input byte 47, statusCode: 401, moreInfo: ))

I printed the output of toke.rawValue and it is : eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX2lkIjoiSW5zdGFuY2Ugb2YgJ0Z1dHVyZTxpbnQ/PicifQ==.devtoken

Steps to reproduce

1. Create a User : final currentChatUser = User(id: currentUserId);
2. Create Development token : final token = client.devToken(currentUserId).rawValue;
3. try to connect user : await client.connectUser(
      currentChatUser,
      token, 
    );

Supporting info to reproduce

No response

Relevant log output

No response

Flutter analyze output

No response

Flutter doctor output

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.3, on macOS 13.6.7 22G720 darwin-x64, locale en-QA)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
[✓] Chrome - develop for the web
[!] Android Studio (version unknown)
    ✗ Unable to determine Android Studio version.
[✓] Android Studio (version 2022.3)
[✓] VS Code (version 1.92.2)
[✓] Connected device (3 available)

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Ali-Farhoud Ali-Farhoud added the bug Something isn't working label Aug 26, 2024
Copy link

This issue is stale because it has been open for 20 days with no activity.

@github-actions github-actions bot added the Stale label Sep 15, 2024
Copy link

This issue was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2024
@deven98 deven98 reopened this Oct 23, 2024
@github-actions github-actions bot removed the Stale label Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants
@deven98 @Ali-Farhoud and others