Software Alternatives & Reviews

Part 3: Authentication and private routes in Gatsby

react-context Auth0
  1. Context provides a way to pass data through the component tree without having to pass props down manually at every level.
    Auth0 React SDK uses React Context, so you can wrap your entire application in an Auth0Provider so that Auth0 knows whether the user is logged in or not, no matter where in the application the user is. When your application is wrapped in Auth0Provider, you can in any component import the useAuth hook like this: import { useAuth0 } from '@auth0/auth0-react' and from useAuth retrieve various methods or properties that have to do with login, for example check if the user is authenticated, bring up a login box, etc. Example: const { isAuthenticated } = useAuth0() makes it easy to later check if the user is logged in by doing this: if (!isAuthenticated) { return }.

    #Javascript UI Libraries #Front-End Frameworks #JS Library 207 social mentions

  2. 2
    Auth0 is a program for people to get authentication and authorization services for their own business use.
    Pricing:
    • Open Source
    However, it soon became apparent that Netlify Identity had some limitations. One was that the login alert was not in Norwegian (I translated it and opened a pull request, but could not wait for it to go through. It's been 7 months now...). The other reason for not sticking with Netlify Identify was that I started working on a dashboard for user account management where I would need some more advanced functionality than Netlify Identity Widget could provide. After some research, I ended up choosing Auth0.

    #Identity And Access Management #Identity Provider #SSO 175 social mentions

Discuss: Part 3: Authentication and private routes in Gatsby

Log in or Post with