Hi. I’m exploring auth0 and have implemented a fairly simple authentication backend in Nodejs. I have a few questions I hope someone can help me with. Documentation is very good but I am not finding exactly what I want.
1- I have a simple express router with a requiresAuth()
middleware. It asks for the user to log in or signup then redirects to a build React folder. Is that the correct way to redirect after authentication? I’m not finding much resources on how to use it with React (as a NodeJS auth backend):
router.get("/dashboard", requiresAuth(), (req, res, next) {
res.sendFile(path.join(__dirname, "..", "..", "build", "index.html"));
}
In the React app, I have a React router route (/dashboard) that displays a dashboard component.
2- The way I have auth set up is I import auth from express-openid-connect
, define the config and export auth(config). I then call app.use(auth0)
in my index.js. I can then use the login and logout routes.
Now when I login or logout, by default, I’m redirected to / (so homepage). Is there a way to overwrite that behavior? I want the login route to direct me somewhere, logout somewhere else.
3- How can I add Facebook and others to the login methods? Currently only Google shows.
4- How does a user sign up? The login route shows a form where you can input your email and password, a forgot password button, and continue with google. Is there a register/signup route built in? And if they do signup, where can I see their username, emails, hashed? password etc.? Basically where are their information and credentials saved, and how can I know they have registered and are able to login, etc.?
5- Can I customize the login form? I tried changing the logo but it didn’t reflect the changes when I was testing locally. And can I change this message: Log in to dev-xz5pbgsq to continue to myapp under the Welcome text, or would that just not show in production?
Apologies for the many questions, but I’m very new to all of this so any help is very appreciated. Thanks