Git Product home page Git Product logo

reactauthorization..ebank's Introduction

The goal of this coding exam is to quickly get you off the ground with Authentication.

Refer to the image below:

ebank-output

Design Files

Login Route
Home Route
Not Found Route

Set Up Instructions

Click to view
  • Download dependencies by running npm install
  • Start up the app using npm start

Completion Instructions

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

API: https://apis.ccbp.in/ebank/login

Method: POST

Request:

{
  "user_id": 142420,
  "pin": 231225
}

Description:

Returns a response based on the credentials provided

Sample Success Response:

{
  "jwt_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IjE0MjQyMCIsInJvbGUiOiJQUklNRV9VU0VSIiwiaWF0IjoxNjM0MDk4NzYyfQ.ZUCC2J2zBjRhLVa1EI_4EnkZ-M-7hoVZoZFAu8GTmEQ"
}

Sample Failure Response:

{
  "status_code": 401,
  "error_msg": "Invalid user ID"
}

Important Note

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 in App.js as we have already included in index.js

  • User credentials

     User ID: 142420
     PIN: 231225
    
    

Resources

Image URLs

Colors
Hex: #152850
Hex: #e0eefe
Hex: #183b56
Hex: #5a7184
Hex: #ffffff
Hex: #c3cad9
Hex: #1565d8
Hex: #ff0b37
Hex: #f8fafc

Font-families
  • Roboto

Things to Keep in Mind

  • All components you implement should go in the src/components directory

reactauthorization..ebank's People

Contributors

vishnuvardhanreddy-n avatar

Watchers

 avatar

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.