Stun3R / strapi-sdk-js

📦 Javascript SDK for your Strapi API
https://strapi-sdk-js.netlify.app
MIT License
143 stars 28 forks source link

React Native (expo) nothing happens when i call strapi.login #199

Closed rrubio closed 3 months ago

rrubio commented 3 months ago

Hi Guys,

I'm using expo to create a react native app. When "login" gets clicked, i can't see the call being made to the server. Am i missing something? or is suitable to use on react native?

This is my config.

const strapi = new Strapi({ 
  url: 'http://localhost:1337/api',
  store: {
    key: 'jwt',
    useLocalStorage: false,
    cookieOptions: { path: '/' },
  },
});

And here i call it and i get an "undefined" error -

  try {  
    const { user, jwt } = await strapi.login({ identifier: 'fadfa', password: 'adsfasdf' });
    return  
  } catch (e) {
    console.log('--- login error ---', e);
  }
rrubio commented 3 months ago

Please ignore. It was an emulator issue, it works as expected.