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

1.0.4 • Public • Published

Build Status Coverage Status MIT license

@yca/auth-local

Installation

  1. Install the dependencies

install @yca/auth

  1. Install the Ionic plugin
 npm i -S @yca/auth-local
  1. Add it to your app’s NgModule.
// Import your library
import { AuthLocalModule } from '@yca/auth-local';

@NgModule({

  ...

  imports: [

    ...

    // Specify your library as an import
    AuthLocalModule.forRoot()

    // or user custom paths
    AuthLocalModule.forRoot({
      root: 'http://xxx.xxx',
      signin: '/signin',
      signup: '/signup',
      reset: '/reset'
    })
  ],
  
  ...

})
export class AppModule { }

Usage

Once your library is imported, you can use its service in your Angular application:

import { AuthLocal } from '@yca/auth-local';

constructor(public al: AuthLocal) {
  al.signin({
    username: 'xxx',
    password: 'xxx',
    ...
  });
}

Methods

signin(params: any): Promise<void>;
signup(params: any): Promise<void>;
reset(params: any): Promise<void>;

Interfaces and Types

export interface AuthLocalPaths {
  root?: string;
  signin?: string;
  signup?: string;
  reset?: string;
}

export const DefaultAuthLocalPaths: AuthLocalPaths = {
  root: 'http://localhost:9000',
  signin: '/auth/local',
  signup: '/auth/local/signup',
  reset: '/auth/local/reset'
}

Development

To generate all *.js, *.d.ts and *.metadata.json files:

$ npm run build

License

MIT © Yu Chen

Readme

Keywords

Package Sidebar

Install

npm i @yca/auth-local

Weekly Downloads

0

Version

1.0.4

License

MIT

Last publish

Collaborators

  • kuyoonjo