Wondering what’s next for npm?Check out our public roadmap! »

@yca/auth-localTypeScript 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 alAuthLocal) {
  al.signin({
    username: 'xxx',
    password: 'xxx',
    ...
  });
}

Methods

signin(paramsany)Promise<void>;
signup(paramsany)Promise<void>;
reset(paramsany)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

Keywords

Install

npm i @yca/auth-local

DownloadsWeekly Downloads

1

Version

1.0.4

License

MIT

Last publish

Collaborators

  • avatar