0.0.8 • Published 7 years ago

@alessandro.castrucci/collina-auth v0.0.8

Weekly downloads
-
License
UNLICENSED
Repository
github
Last release
7 years ago

collina-auth

Excercise for NodeJS Workshop

AuthService

Fast & simple storage - a Node.js-style LevelDB wrapper

Build Status dependencies

NPM NPM

  • Introduction
  • Basic Usage

Introduction

AuthService is a simple ....

Basic usage

First you need to install AuthService!

$ npm install collina-auth

All operations are asynchronous although they don't necessarily require a callback if you don't need to know when the operation was performed.

const user = {
    username: 'foo',
    password: 'password',
    details: {
      a: 'b',
      c: 'd',
    },
  }
let conf = {
    dbname: 'bar'
  }
var auth = require('collina-auth')(conf)

// 1) Add user, supply details.
//    This will create user on  the underlying store.
auth.addUser(user, function(err) {
	if(err) /*handle!!!*/ return
	//.. do stuff
})
// 2) Fetch User details
auth.fetchDetails('foo', function(err, details) {
	if(err) /*handle!!!*/ return
		//.. do stuff with details
	})
})
// 3) Validate credentials
auth.authenticate('foo', 'password', function(err){
	if(err) /*handle!!!*/ return
		//.. do stuff
})
0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.1

7 years ago