Giter Site home page Giter Site logo

Comments (6)

vishalnarkhede avatar vishalnarkhede commented on May 21, 2024

Hey @harrisonschwartz,

Client generated using secret key is only meant to be used on serverside. Seems like you are using it on clientside (on browser or mobile - react-native)

from stream-chat-react-native.

vishalnarkhede avatar vishalnarkhede commented on May 21, 2024

@syntax-e ping. Any update on this? Do you have any followup questions on this?

from stream-chat-react-native.

vishalnarkhede avatar vishalnarkhede commented on May 21, 2024

Closing this for now. Please reopen if you have more questions!!

from stream-chat-react-native.

theRealSheng avatar theRealSheng commented on May 21, 2024

@vishalnarkhede how do I obtain the token by creating a user in the stream-CLI?

According to the docs:

"For development applications, it is possible to disable token authentication and use client-side generated tokens. Disabling auth checks is not suitable for a production application and should only be done for proofs-of-concept and applications in the early development stage. To enable development tokens, you need to change your application configuration."

I have also tried to use chatClient.devToken(id) and I'm getting the following error:

{
"code":5,"
StatusCode":401,
"message":"WS failed with code 5 and reason - development tokens are not allowed for this application",
"isWSFailure":false
}

Thanks in advance!

from stream-chat-react-native.

bgeisb avatar bgeisb commented on May 21, 2024

If someone has the same problem:

The following post solved my problem:
https://stackoverflow.com/questions/62054421/how-do-i-enable-devtokens-on-getstream-io

from stream-chat-react-native.

thechaudharysab avatar thechaudharysab commented on May 21, 2024

@vishalnarkhede I'm getting TypeError: null is not an object (evaluating 'jwt.sign') and it's because of this code:

  useEffect(() => {
    const connectStreamUser = async () => {
      try {
        await chatClient.connectUser(
          {
            id: 'talha',
            name: 'Test User'
          }, chatClient.devToken('talha'),
        );
      } catch (error) {
        console.log('----------ERROR-----------');
        console.log(err);
      }
    }

    if (!chatClient.userID) {
      console.log('------NO USER ID----------');
      connectStreamUser();
    }
  }, []);

Any solution or what I might do differently?

from stream-chat-react-native.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.