Giter Site home page Giter Site logo

auth-app's Introduction

Auth App

Created a NodeJS app and user can send get request to this link https://auth-app-mern.herokuapp.com/api to get a greeting message

Password

Created a Database in MongoDB and connected it to the application using mongoose, API to register user is created and user can create account by sending POST request to this link https://auth-app-mern.herokuapp.com/api/signup, the body should contain firstname,lastname,email,phone,address,password in json format, the email should be valid and the pasword should be minimum 8 characters. If the user already exists then API responds with message User Exists

Passwords are stored in database in hashed format

Created an API to log in user, user can send POST request to this link https://auth-app-mern.herokuapp.com/api/login to login, the body of the request should contain email and password and the email should be valid, if the password is incorrect then the API responds with message Password is incorrect. If email and password is correct then it responds with the json web token created using mongo db id of the user

Created an API which takes json web token as header and validates it and if it is valid then it responds with the profile data of the user (specifically firstname, lastname, email, phone and address). This API can be accessed through making a GET request in following link https://auth-app-mern.herokuapp.com/api/profile

Created a Signup route in react APP which takes firstname, lastname, email, phone,address and password from the user and then makes a POST request to API to create a new user. The form has all the validation it also checks whether the email is valid or not and if the password it minimum 8 characters or not and it all the data is correct it gives message to the user that the user is created successfully and if the email already exists it gives error to user that the email already exists. This route can be accessed by this link https://auth-app-mern.herokuapp.com/signup

Created a login route which accepts email and password from user and validates the email and if the email is valid then makes a POST request to the API to validate the credentials given by user,if credentials are valid then it responds with json web token, Json web token is then stored in the local storage to manage login session. If the password is incorrect then it gives error to user. This route can be accessed by https://auth-app-mern.herokuapp.com/login

Created a Profile Route which can only be accessed if the user is logged in and has a valid json web token. This page displays the information of user which is stored in Mongo DB like firstname, lastname, phone, address and email. This route can be accessed by https://auth-app-mern.herokuapp.com/profile. If the user is not logged in it redirects to login page

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.