reazy-auth
A simple auth store for your Reazy apps
Installation
Reazy CLI
1. Using$ reazy add auth
2. Manual
- Install
reazy-auth
$ npm install --save reazy-auth
- Add these lines to your
src/app.js
.
;; // <-- import the service; const app = ; app; // <-- Initialize the serviceapp; ;
Usage
This Reazy plugin is just an authentication store service. For full implementation of authentication, use this with one of the following:
Let's assume you have registered this service with name auth
. Then you can access the service in two ways:
const authService = appauth;// ORconst authService = app;
This service provides the following functions:
-
setUser(user)
appauth; -
getUser()
const user = appauth; -
user()
Alias of
getUser
-
setToken(token)
appauth; -
getToken()
const token = appauth;