New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@wrserver/auth

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wrserver/auth

wrserver - auth module

latest
Source
npmnpm
Version
1.2.2
Version published
Maintainers
1
Created
Source

WRServer/Auth

License Email Donate Donate

@wrserver auth module to manage user login/logout/registration/validation/settings

Installing

Install this library is easy by cloning the repo. You can install trhought npm too:

Local installation

npm install @wrserver/auth

Global installation

npm install -g @wrserver/auth

We recomend to use the entire base package (core, crypt, data, auth, mail)

AuthController

This module add the AuthController to the WRServer Set of elements. It provides a list of pages usefull to manage accounts server-side. Pages are: login, logout, register, verify, password (change), email (change). It depends ond DataModel and automatically use the DataService to manage a json table for user anagrafic storage.

Use AuthModule

At Server definition (settings)

import { WRServer }from '@wrserver/core';
import { AuthModule } from '@wrserver/auth';

//REMEMBER: don't use this static methods inside module definitions
AuthModule.withEncrypt(true|false).withMailHost(<hosts: [gmail.com, yahoo.com, ...]>)
            .withService(<mail service: gmail>).withUser(<username>).withPass(<password>)
            .withRegistrationMail(<AuthRegistrationMail>)
//Server definition
let server: WRServer = new WRServer(<dir>, <port>, [ AuthModule, ... Other Modules ... ], ...)

Use AuthController

From your client send message for:

Login Page

{ 
    "target": "auth",
    "section": "auth",
    "page": "login",
    "data": { "name": <name>, "password": <password> }
}

Logout Page - [After logged in]

{ 
    "target": "auth",
    "section": "auth",
    "page": "logout"
}

Register Page

{ 
    "target": "auth",
    "section": "auth",
    "page": "register",
    "data": { "name": <name>, "password": <password>, "email": <email> }
}

Verify Page

{ 
    "target": "auth",
    "section": "auth",
    "page": "verify",
    "data": { "name": <name>, "token": <registrationToken> }
}

Password (change) Page - [After logged in]

{ 
    "target": "auth",
    "section": "auth",
    "page": "password",
    "data": <newPass>
}

Email (change) Page - [After logged in]

{ 
    "target": "auth",
    "section": "auth",
    "page": "email",
    "data": <newEmail>
}

Contacts

If you like the project feel free to contact me on my Email.

Something gone wrong? Feel free to rise an issue!

Did you like this project and it was usefull? Help me improve my work:

Donate Donate

FAQs

Package last updated on 22 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