Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

auth-service-module-prodio

Package Overview
Dependencies
Maintainers
5
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

auth-service-module-prodio

NPM for consuming prodio auth service

  • 1.0.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
16
increased by1500%
Maintainers
5
Weekly downloads
 
Created
Source

auth-service-module-prodio

Build Status

auth-service-module-prodio is an node js client for the auth-service-prodio API. Integrate in to any application to perform auth releted user journeys.

Features!

  1. Signup/Register Account
  2. Verify Account
  3. Regenerate OTP/verification token
  4. Login
  5. List Accounts
  6. Forgot Password
  7. Reset Password
  8. Unregister/Deactivate Account

Prerequisite:

  • Clone this repository on your server git clone https://github.com/ProdioDesignWorks/auth-service-prodio.git
  • Navigate to your repo cd auth-service-prodio
  • Install dependencies npm install
  • Start service node . or npm start or node server/server.js
  • If you've pm2 installed then use this pm2 start server/server.js --name="AUTH_SERVICE"

Note:

auth-service-prodio uses loopback as the core framework for developing API's, so all customisations, configurations, middlewares, events, and db connectors can be used which you would have used in loopback.

Installation

$ npm install auth-module-prodio --save

Initialization

Require the auth-module-prodio module and initialize the notificationSdk client.


 const auth = require('auth-service-module-prodio');
 const authModule = new auth("API BASE PATH OF AUTH SERVICE");//http://domainname:3005/api

Method

1. Signup/Register: This will create/register a new account.

Payload

KeyTypeValueDescriptionRequired
actionstringREGISTERACCOUNTkey which defines the type of action to be performedYES
metajsonrefer example below-YES
Example
	const emailMetaInfo = {
		"email": "",
		"password": ""
	};
	const otpMetaInfo = {
		"phone": ""
	}
	const  payload = {
		"action": "REGISTERACCOUNT",
		"meta": emailMetaInfo // or otpMetaInfo
	};
	let account = authModule.execute(payload);

2. Verify Account Token: This will verify an account.

Payload

KeyTypeValueDescriptionRequired
actionstringVERIFYTOKENkey which defines the type of action to be performedYES
metajsonrefer example below-YES
Example
	const emailMetaInfo = {
		"verificationToken": ""
	};
	const otpMetaInfo = {
		"phone": "",
		"otp": ""
	}
	const  payload = {
		"action": "VERIFYTOKEN",
		"meta": emailMetaInfo // or otpMetaInfo
	};
	let verify = authModule.execute(payload);

3. Generate email verification token or otp: This will regenerate verification tokens.

Payload

KeyTypeValueDescriptionRequired
actionstringGENERATETOKENkey which defines the type of action to be performedYES
metajsonrefer example below-YES
Example
	const emailMetaInfo = {
		"email": ""
	};
	const otpMetaInfo = {
		"phone": ""
	}
	const  payload = {
		"action": "GENERATETOKEN",
		"meta": emailMetaInfo // or otpMetaInfo
	};
	let token = authModule.execute(payload);

4. Login: This will validate login of an account if email based. If otp based, will generate an otp which will have to verified using verify account token method(2).

Payload

KeyTypeValueDescriptionRequired
actionstringLOGINkey which defines the type of action to be performedYES
metajsonrefer example below-YES
Example
	const emailMetaInfo = {
		"email": "",
		"password":""
	};
	const otpMetaInfo = {
		"phone": ""
	}
	const  payload = {
		"action": "LOGIN",
		"meta": emailMetaInfo // or otpMetaInfo
	};
	let login = authModule.execute(payload);

5. List accounts: This will list all the accounts.

Payload

KeyTypeValueDescriptionRequired
actionstringLISTACCOUNTSkey which defines the type of action to be performedYES
metajsonrefer example below-YES
Example
	const  payload = {
		"action": "LISTACCOUNTS"
	};
	let accounts = authModule.execute(payload);

6. Forgot Password: Only for email based auth. It will generate an token which will be required when resetting the password.

Payload

KeyTypeValueDescriptionRequired
actionstringFORGOTPASSWORDkey which defines the type of action to be performedYES
metajsonrefer example below-YES
Example
	const emailMetaInfo = {
		"email": ""
	};
	const  payload = {
		"action": "FORGOTPASSWORD",
		"meta": emailMetaInfo
	};
	let forgot = authModule.execute(payload);

7. Reset Password: Only for email based auth. Based on the token generated in forgot password, new password can be created.

Payload

KeyTypeValueDescriptionRequired
actionstringRESETPASSWORDkey which defines the type of action to be performedYES
metajsonrefer example below-YES
Example
	const emailMetaInfo = {
		"verificationToken": "",
		"password": ""
	};
	const  payload = {
		"action": "RESETPASSWORD",
		"meta": emailMetaInfo
	};
	let reset = authModule.execute(payload);

8. Change Password: Only for email based auth. Change an existing password.

Payload

KeyTypeValueDescriptionRequired
actionstringCHANGEPASSWORDkey which defines the type of action to be performedYES
metajsonrefer example below-YES
Example
	const emailMetaInfo = {
		"email": "",
		"oldPassword": "",
		"newPassword": ""
	};
	const  payload = {
		"action": "CHANGEPASSWORD",
		"meta": emailMetaInfo
	};
	let change = authModule.execute(payload);

8. Delete Account: Will delete the account and no other action can be done using the account further.

Payload

KeyTypeValueDescriptionRequired
actionstringDELETEACCOUNTkey which defines the type of action to be performedYES
metajsonrefer example below-YES
Example
	const emailMetaInfo = {
		"email": "",
	};
	const otpMetaInfo = {
		"phone": ""
	}
	const  payload = {
		"action": "DELETEACCOUNT",
		"meta": emailMetaInfo // or otpMetaInfo
	};
	let delete = authModule.execute(payload);

Keywords

FAQs

Package last updated on 29 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc