Giter VIP home page Giter VIP logo

Comments (7)

leon-wbr avatar leon-wbr commented on August 11, 2024

I figured out that it was because client only authentication isn't implemented yet.

from redux-auth.

lynndylanhurley avatar lynndylanhurley commented on August 11, 2024

Client-only authentication should have been implemented in #50. Have you tried setting the clientOnly param in the config block?

https://github.com/lynndylanhurley/redux-auth#configure

from redux-auth.

leon-wbr avatar leon-wbr commented on August 11, 2024

This is my configure now. On sign in, the authorization token is given, but the request still sends authorization: bearer undefined.

function renderApp() {
  store.dispatch(configure(
    {apiUrl: "http://127.0.0.1:3000"},
    {clientOnly: true, cleanSession: true}
  )).then(() => {
    ReactDOM.render(
      <Provider store={store} key="provider">
        <App />
      </Provider>,
      document.getElementById('react-root')
    )
  });
}

from redux-auth.

yury-dymov avatar yury-dymov commented on August 11, 2024

@leon-wbr take a look https://github.com/yury-dymov/redux-oauth-client-demo, hope it helps :)

from redux-auth.

leon-wbr avatar leon-wbr commented on August 11, 2024

@yury-dymov Thanks, but no luck so far! I suppose it could be due to me not dispatching fetch, but if I wrap it in a dispatch I get an error Error: Actions must be plain objects. Use custom middleware for async actions.

Edit: Okay, I don't think that's the issue. Dispatching seems to be necessary for redux-oauth but not redux-auth.

from redux-auth.

yury-dymov avatar yury-dymov commented on August 11, 2024

@leon-wbr, this is correct, you can't use both libraries :) I am sorry that dispatch is required for fetch but I need to update headers in redux store and I can't do that without dispatching

from redux-auth.

leon-wbr avatar leon-wbr commented on August 11, 2024

It was actually an issue with my server's CORS. I was accepting all headers, but not exposing the relevant ones. Sorry for wasting your time.

from redux-auth.

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.