0.1.1 • Published 9 years ago

syn-auth v0.1.1

Weekly downloads
8
License
GPL-3.0
Repository
github
Last release
9 years ago

syn-auth

Auth module.

Getting started

Install the module in a node 4+ environment.

$ npm install syn-auth

If you are going to use components you can do either options:

  • SASS: Add syn-auth sass to your sass
@import "path/to/node_modules/syn-auth/src/index.scss";
  • CSS: Add css file to your page
<link type="text/css" href="path/to/node_modules/syn-auth/dest/index.css" />

If you can't see the font properly, copy it to the fonts folder

/fonts

Services

AuthResource

A service to authenticate user/pass through a webservice.

Example of use:

auth = new syn.auth.resource.Auth( 'http://my-api.fake/login' )
auth.login( 'my-user', 'my-password' )
  .then ( session ) =>
    console.log 'Welcome ' + session.user().name() + '!!!'
  .catch ( error ) =>
    console.log error

SessionGlobal

A service set and retrieve a unique session object.

Example of use:

gSession = syn.auth.session.global

if !gSession.get()
  document.href.location = '/login-page'
  
gSession.on session.CHANGE, ( session ) ->
  # Stuff to do whenever session changes

Components

<syn-auth-login-form @url @channel />

Basic login form. To see an example, execute the demo:

$ gulp serve

and open http://localhost:3000/docs/

0.1.1

9 years ago

0.1.0

9 years ago

0.0.17

9 years ago

0.0.16

9 years ago

0.0.15

9 years ago

0.0.14

9 years ago

0.0.13

9 years ago

0.0.12

9 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago