1.2.0 • Published 7 years ago
xin-jwt v1.2.0
xin-jwt
JSON Web Token middleware for Xin
Usage
We can use xin-jwt middleware as component inside template scope of App component instance directly
<xin-app>
<template>
<xin-jwt whitelist='["/login", "/test"]' (signout)='navigate("/login")'></xin-jwt>
</template>
</xin-app>
Or programmatically
import { App } from 'xin/components';
import JwtMiddleware from 'xin-jwt';
class TheApp extends App {
created () {
super.created();
this.use((new JwtMiddleware()).callback());
}
}
define('the-app', TheApp)
1.2.0
7 years ago