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

userToken must be provided while running on client-side error #88

Closed
5 tasks
RizanPSTU opened this issue Jun 9, 2021 · 3 comments
Closed
5 tasks

userToken must be provided while running on client-side error #88

RizanPSTU opened this issue Jun 9, 2021 · 3 comments
Labels
question Further information is requested

Comments

@RizanPSTU
Copy link

Describe the bug
I am getting E/flutter (17650): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Assertion failed: "userToken must be provided while running on client-side" with secret
But in the example you are using fine
Screenshot 2021-06-09 at 11 11 29 PM

What version of Flutter do you use?
2.2.1

What package are you using? What version?
0.2.1

What platform is it about?

  • [ *] Android
  • iOS
  • Web
  • Windows
  • MacOS
  • Linux

a copy of flutter doctor --verbose
[✓] Flutter (Channel stable, 2.2.1, on macOS 11.3.1 20E241 darwin-x64, locale en-GB)
• Flutter version 2.2.1 at /Users/rizan/flutter
• Framework revision 02c026b03c (13 days ago), 2021-05-27 12:24:44 -0700
• Engine revision 0fdb562ac8
• Dart version 2.13.1

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/rizan/Library/Android/sdk
• Platform android-S, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5, Build version 12E262
• CocoaPods version 1.10.1

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 4.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.8+10-b944.6916264)

[✓] VS Code (version 1.56.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.23.0

[✓] Connected device (2 available)
• Android SDK built for x86 (mobile) • emulator-5554 • android-x86 • Android 10 (API 29) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 91.0.4472.77

To Reproduce
Steps to reproduce the behavior:

  1. Trying to connect with final StreamFeedClient _streamSDKFeedClient = StreamFeedClient.connect(StreamAPIKey.value, secret: StreamAPISecret.value);
  2. But giving me the error E/flutter (17650): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Assertion failed: "userToken must be provided while running on client-side"

Expected behavior
It should crate the client

Screenshots
Screenshot 2021-06-09 at 11 09 57 PM

**Logs **
E/flutter (17650): [ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: Assertion failed: "userToken must be provided while running on client-side"

@RizanPSTU RizanPSTU added the bug Something isn't working label Jun 9, 2021
@RizanPSTU
Copy link
Author

@xsahil03x @sachaarbonel @Nash0x7E2 Please help me.

@sachaarbonel
Copy link
Member

sachaarbonel commented Jun 9, 2021

hey @RizanPSTU sorry for the inconvenience but we missed to update the Flutter sample when we introduced this "security" mechanic. It's highly advised to not use a secret on any client-side devices (whether in the browser, in mobile, or desktop). You should rather create a user token programmatically (serverside) or using this link on our website. The secret option is here for users that want to use the SDK serverside.

@sachaarbonel sachaarbonel added question Further information is requested and removed bug Something isn't working labels Jun 9, 2021
@RizanPSTU
Copy link
Author

RizanPSTU commented Jun 9, 2021

Ok, I am closing the issue. Got my answer. Thanks :) @sachaarbonel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants