🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

@rss/auth-angular

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rss/auth-angular

auth module for angular

0.0.3
latest
Version published
Maintainers
1
Created

@rss/auth-angular

Helper library for working with token server on angular

Installation

$ npm install @rss/auth-angular

Client Usage (angular)

Initialize

Client.checkIfAuthenticated should be call in the app.component

import { Client } from '@rss/auth/angular-angular';

export class AppComponent {
  ngOnInit() {
    Client.checkIfAuthenticated(this.location, 'URL_TO_AUTHENTICATE_USER').then(() => {
      // user is authenticated - load profile
    });
  }
}

Client API

Client.checkIfAuthenticated(location, 'URL_TO_AUTHENTICATE_USER')

check if user is authenticate. if not, redirect user to authentication url

Client.getUserToken()

get user token if available

Client.redirectToAuthentication('URL_TO_AUTHENTICATE_USER')

redirect user to token server for authentication

FAQs

Package last updated on 25 Apr 2017

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