Giter Club home page Giter Club logo

pppauth's Introduction

#Authentication Service using mongo for user data

Example outputs are all happy path

Mail for verification is send by mailtrap currently

#Env variables PORT=8000 MONGO_INITDB_ROOT_USERNAME MONGO_INITDB_ROOT_PASSWORD MONGODB_LOCAL_URI MONGODB_URI ACCESS_TOKEN_PRIVATE_KEY ACCESS_TOKEN_PUBLIC_KEY ACCESS_TOKEN_EXPIRED_IN=15m ACCESS_TOKEN_MAXAGE=15 REFRESH_TOKEN_PRIVATE_KEY REFRESH_TOKEN_PUBLIC_KEY REFRESH_TOKEN_EXPIRED_IN=60m REFRESH_TOKEN_MAXAGE=60

EMAIL_FROM=[email protected] SMTP_HOST=sandbox.smtp.mailtrap.io SMTP_USER SMTP_PASS SMTP_PORT=587

#Routes /api/auth/register Input: { "email": "[email protected]", "name": "John Doe", "password": "password123", "passwordconfirm": "password123" }

Output: { "message": "We sent an email with a verification code to [email protected]", "status": "success" }

/api/auth/login Input: { "email": "[email protected]", "password": "password123" } Output: { "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NzkzNTAzNTMsImlhdCI6MTY3OTM0OTQ1MywibmJmIjoxNjc5MzQ5NDUzLCJzdWIiOiI2NDE0ZjdjMTZkZTgyZjk0NDNjNGY5YWMifQ.DG0gVjwZey7INUiof-yMIukzDxSrf7VGcPgVR-jgJ0o9_gv5l20CPotDNM11igTr_euo3BaTglexobGTv1nup0-Vhsr4Kmg-v8Gaj89eYJQa2Nc3LGZBlwuPfL7OOwywBwXgBqy4-B6pINzcBGXkrGVabe_ZUAVRMZVOFLhRZ4M", "status": "success" }

/api/auth/logout Output: { "status": "success" }

/api/auth/refresh Output: { "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NzkwOTY2ODQsImlhdCI6MTY3OTA5NTc4NCwibmJmIjoxNjc5MDk1Nzg0LCJzdWIiOiI2NDE0ZjdjMTZkZTgyZjk0NDNjNGY5YWMifQ.CoQah_UeYPO018G6kX2dTyt3rCt8iBusDMfWYptVMlNNu55V2tLj5z0jdvS7MviRIkos1rx4ZKmbCSJ2b_hGB17MDsLEUw09CzzAspY6XMJ82yfIAX6QE4oE_C8RM4ZOZj1CdQuSDIuXKwVxVHL03573QdoTYd9klmGki30hAP8", "status": "success" }

/api/auth/verifyemail/:TOKEN output: { "message": "Email verified successfully", "status": "success" }

/api/auth/forgotpassword Input: { "email": "[email protected]" } Output: { "message": "You will receive a reset email if user with that email exist", "status": "success" }

/api/auth/resetpassword/:TOKEN Input: { "password": "password123", "passwordconfirm": "password123" } Output: { "message": "Password data updated successfully", "status": "success" }

/api/users/me Output:{ "data": { "user": { "id": "6414f7c16de82f9443c4f9ac", "name": "John Doe", "email": "[email protected]", "role": "user", "created_at": "2023-03-17T23:29:05.499Z", "updated_at": "2023-03-17T23:29:05.499Z" } }, "status": "success" }

pppauth's People

Contributors

charichu 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.