1.3.0 • Published 7 years ago

@frannca/ngx-login v1.3.0

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

ngx-login

Login library for Angular 4+

npm Travis PRs Welcome Commitizen friendly semantic-release

This library is focused on Angular authentication and is part of Frannca's Solutions to save time on projects development.

Table of Contents

Installation

You need npm to install the package. If you do not have npm installed, follow this instructions.

npm

npm install @frannca/ngx-login --save

Usage

The library is packed with everything you need to get login works.

Import the module

The first thing you have to do, is to import the NgxLoginModule in the AppModule:

NgxLoginModule.forRoot({
  apiUrl: 'API_URL',
})

Insert the component

Now you just need to insert the component where you want the login to be displayed:

<app-ngx-login></app-ngx-login>

Configuration

The ngx-login comes with nice configuration options:

OptionDefault ValueDescription
color'frannca'Login box color
fieldOne'email'Name of the first field used for the API
fieldTwo'password'Name of the second field used for the API
logoNGX_LOGIN_LOGOLogin logo
messageError'Error!'Toastr error title
messageSuccess'Success!'Toastr success title
prefix'ngxlogin'Prefix used by the localStorage
redirect'/'Angular internal redirect
redirectExternalnullAngular external redirect

NGX_LOGIN_LOGO: this is a constant with the ngx-login base64 logo.

Requirements

  • Angular 4 or higher
  • Toastr 6.0.0

Contributing

We would love to have your contributions. Please read the CONTRIBUTING.md file for more information.

Copyright and license

Code copyright 2018 Frannca. Code released under the MIT license.