@starnetbih/au2-auth
TypeScript icon, indicating that this package has built-in type declarations

0.2.3 • Public • Published

au2-auth

This library is a based on aurelia2-auth plugin and previous work done by SpoonX.

Full disclosure: this plugin is in alpha stage. Use at your own risk.

Installation

npm install @starnetbih/au2-auth or yarn add @starnetbih/au2-auth

Configuration

Inside of your main.ts/main.js file register the plugin on the register method:

import { AureliaAuthConfiguration } from '@starnetbih/au2-auth';

Aurelia.register(AureliaAuthConfiguration); 

//Or configure
Aurelia.register(
     AureliaAuthConfiguration.configure({responseTokenProp: 'bearerToken'})
);

Usage

import { IAppConfiguration } from '@starnetbih/au2-auth';

export class MyApp {

    constructor( @IAuthService private Auth: IAuthService ) { }

    async attached() {
        let resp = await this.Auth.login({
            credentials: { username: "admin", password: "admin" }
        });
        console.log(this.Auth.getTokenPayload());
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @starnetbih/au2-auth

Weekly Downloads

1

Version

0.2.3

License

MIT

Unpacked Size

124 kB

Total Files

46

Last publish

Collaborators

  • hdzcalmir
  • aner78
  • stefannj
  • zeko77