Code Monkey home page Code Monkey logo

Comments (5)

samudurand avatar samudurand commented on June 16, 2024 1

@lukeoliff looks good ! however I am still wondering why it is not synchronous ? As far as I know this does not require any external http call ? So why bother with asynchronous ?

from auth0-react-samples.

upanshed avatar upanshed commented on June 16, 2024

Im having the same issue, did you find a solution?

from auth0-react-samples.

samudurand avatar samudurand commented on June 16, 2024

@upanshed I changed my code to do a manual redirect instead , you can do that by getting the router directly from the Router directive and passing that to the authentication method

 <Route path="/callback" render={({history}) => {
                auth.extractAndSaveUserToken(() => {
                   history.push("/");
                }, () => {
                  history.push("/authError");
                });
                return (<div>Loading</div>);
              }} />

from auth0-react-samples.

lukeocodes avatar lukeocodes commented on June 16, 2024

Hey @samudurand sorry for being late to this!

I addressed this exactly recently in a demo app. Check out this: I provide some state aware functions to be used as callbacks in my auth utility class.

https://github.com/lukeoliff/auth0-react-material/blob/master/www-client/src/components/App.js

from auth0-react-samples.

jimmyjames avatar jimmyjames commented on June 16, 2024

Closing this issue since we've just recently made some significant changes to this sample and Quickstart, utilizing the new auth0-spa-js SDK. If you continue to experience this issue or any others, don't hesitate to create a new issue. Thanks!

References:

from auth0-react-samples.

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.