1.1.2 • Published 8 years ago

qipp-services-session v1.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

qipp-services-session Build Status npm version js-standard-style

General

The session factory provides three methods in order to deal with the state of the user session in your angular application.

Install

npm i qipp-services-session

Angular usage

init method

The init() method shouldn't be used by itself in your application, as it is called by the resolveRoute provider of the qipp-services-route module:

session.init().then(function () {
    // Do something.
})

Basically, on each route resolving, this method is called, which is in fact a promise, in order to handle the locale.

update method

The update() method should be fired during the login and the registration sequences, after a successfull authentication with the auth service. It populate the user object, save it with the io service, and finally redirect the user to home or to the provided argument:

session.update()
session.update('some/path')

destroy method

Thee destroy() method should be used to reset the user object, to clear the io data and to redirect the user to home:

session.destroy()

Tools

Linting with StandardJS

Please refer to the JavaScript Standard Style for general rules.

npm run lint

Unit testing with Karma

npm test

Requirements

Angular

Qipp modules

Licence

Released under the MIT license by qipp.