New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

mdds-angular-auth

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdds-angular-auth

Augular Authentication and Authorization Module

latest
npmnpm
Version
0.7.110
Version published
Maintainers
1
Created
Source

Augular Authentication and Authorization Module

Usage:

  • Add 'mdds-angular-auth" package as dependency in your project in file package.json:

For example:

"dependencies": { "@angular/common": "^6.0.3", "@angular/core": "^6.0.3", "@angular/forms": "^6.0.3", "@angular/http": "^6.0.3", "@angular/router": "^6.0.3", "rxjs": "^6.0.0", "zone.js": "^0.8.26", ... ... "mdds-angular-auth": "" },

  • Create a auth.config.ts to add the following two configuration variables required by 'mdds-angular-auth' logic:

export const authentication_login_page_uri: string = '/auth/login'; export const authentication_server_root_uri: string = '/api/auth';

  • Declare two providers in your app.module.ts:

import { AUTHENTICATION_LOGIN_PAGE_URI, AUTHENTICATION_SERVER_ROOT_URI } from 'mdds-angular-auth'; import { authentication_login_page_uri, authentication_server_root_uri } from './auth.config'; ... @NgModule( ... providers: [ ... { provide: AUTHENTICATION_LOGIN_PAGE_URI, useValue: authentication_login_page_uri }, { provide: AUTHENTICATION_SERVER_ROOT_URI, useValue: authentication_server_root_uri }

] ...

  • Import 'AuthenticationModule' in app.module.ts:

import { AuthenticationModule } from 'mdds-angular-auth'; ...

@NgModule( ... imports: [ ... AuthenticationModule ], ...

  • Use AuthGuard to application routers:

import {AuthGuard} from 'mdds-angular-auth'; ... routes: Routes = [ { path: 'path/to/guard', component: ComponentToGuard, canActivate: [AuthGuard], } ... ] ...

  • Use the authenticaiton icon in your HTML:

app.component.html

...

Keywords

Angular

FAQs

Package last updated on 12 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts