1.2.0 • Published 7 years ago

xin-jwt v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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)