izi-auth

0.0.2 • Public • Published

izi-auth

Simple authentication management module for izisoft web application.

Installation

$ npm install izi-auth

Requirements

Module operates on provided mongoose user model that should realize following schema:

User: {
    _id: ObjectId,
    provider: String,
    email: String,
    password: String,
    id: String,
    token: String
    name: String,
    generateHash: function(password),
    verifyPassword: function(password),
    initialize: function(request || undefined)
}

To initialize strategies module reads given izi-config object which should contain:

Config: {
    logger: Object,
    auth: {
        url: {
            success: String || "/",
            login: String,
            signup: String
        },
        flash: Boolean || true,
        oauth: {
            facebook: {
                id: String,
                secret: String,
                url: String,
                opts: Object
            },
            google: {
                id: String,
                secret: String,
                url: String,
                opts: Object
            },
            twitter: {
                id: String,
                secret: String,
                url: String,
                opts: Object || {}
            }
        }
    }
}

Usage

var auth = require('izi-auth');
auth.init(UserModel, config);
auth.use(app);

Readme

Keywords

Package Sidebar

Install

npm i izi-auth

Weekly Downloads

1

Version

0.0.2

License

ISC

Unpacked Size

8.03 kB

Total Files

5

Last publish

Collaborators

  • izisoft