qipp-services-session
v1.1.2
Published
Session service for Angular application.
Downloads
1
Readme
qipp-services-session
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
- angular 1.4.3
Qipp modules
- qipp-services-auth 1.1.2
- qipp-services-auth 1.1.1
- qipp-services-auth 1.0.1
- qipp-services-auth 2.1.1
- qipp-services-auth 1.0.2
- qipp-services-auth 1.0.3
- qipp-services-auth 0.1.0
- qipp-services-auth 1.0.0
Licence
Released under the MIT license by qipp.