The goal of this coding exam is to quickly get you off the ground with Authentication.
Login Route
Not Found Route
Click to view
- Download dependencies by running
npm install
- Start up the app using
npm start
Functionality to be added
The app must have the following functionalities
-
Login Route
- When invalid credentials are provided and the Login button is clicked, then the error message received from the response should be displayed
- When valid credentials are provided and the Login button is clicked, then the page should be navigated to the Home Route
- When an unauthenticated user tries to access the Home Route, then the page should be navigated to Login Route
- When an authenticated user tries to access the Home Route, then the page should be navigated to the Home Route
-
Home Route
- When an authenticated user tries to access the Login Route, then the page should be navigated to the Home Route
- When the Logout button is clicked, then the page should be navigated to the Login Route
-
Not Found Route
- When a random path is provided in the URL, then the page should be navigated to the Not Found Route
API Requests & Responses
loginApiUrl
{
"user_id": 142420,
"pin": 231225
}
Returns a response based on the credentials provided
{
"jwt_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IjE0MjQyMCIsInJvbGUiOiJQUklNRV9VU0VSIiwiaWF0IjoxNjM0MDk4NzYyfQ.ZUCC2J2zBjRhLVa1EI_4EnkZ-M-7hoVZoZFAu8GTmEQ"
}
{
"status_code": 401,
"error_msg": "Invalid user ID"
}
Click to view
The following instructions are required for the tests to pass
-
Home Route should consist of
/
in the URL path -
Login Route should consist of
/ebank/login
in the URL path -
No need to use the
BrowserRouter
inApp.js
as we have already included inindex.js
-
User credentials
User ID: 142420 PIN: 231225
Image URLs
-
https://assets.ccbp.in/frontend/react-js/ebank-login-img.png alt should be website login
-
https://assets.ccbp.in/frontend/react-js/ebank-logo-img.png alt should be website logo
-
https://assets.ccbp.in/frontend/react-js/ebank-digital-card-img.png alt should be digital card
-
https://assets.ccbp.in/frontend/react-js/ebank-not-found-img.png alt should be not found
Colors
Font-families
- Roboto
- All components you implement should go in the
src/components
directory