This project is a simple authentication dashboard using Auth0 for authentication. It includes a main dashboard page with three buttons, each leading to a specific form after authentication.
.
├── auth_config.json # Auth0 configuration
├── index.html # Main dashboard page
├── package.json # Project dependencies
├── package-lock.json # Lock file for dependencies
├── public
│ ├── css
│ │ └── main.css # Stylesheet for forms
│ └── js
│ └── app.js # JavaScript logic
├── server.js # Express server
- Clone the repository
git clone <repository-url> cd <project-folder>
- Install dependencies
npm install
- Start the server
The application will run on
npm start
http://localhost:3000
- User clicks Button 1, 2, or 3 on the dashboard.
- The system connects to Auth0 for authentication.
- If the user is authenticated, a token is generated.
- The token is used to call a web service.
- The user is redirected to the respective form (Form 1, 2, or 3).
- The form appears with a Submit button.
For testing, you can use the following credentials:
- Email: testuser@me.com
- Password: Test@1212
Contains:
- Three buttons (
Button 1,Button 2,Button 3) - Three hidden forms (
Form 1,Form 2,Form 3) - Loads Auth0 SPA SDK
- Includes
app.jsfor logic
Handles:
- Initializing Auth0 client
- Authenticating users
- Generating and logging token
- Redirecting to the corresponding form
- Uses Express to serve static files.
- Provides an endpoint to fetch auth_config.json.
public/css/main.csscontains basic styling.- Hidden forms are managed using the
.hiddenclass.
For auto-restarting the server during development, use:
npm run devThis project demonstrates a simple Auth0-based authentication system where users log in before accessing different forms. You can customize it further as needed.