0.0.3 • Published 7 years ago

@rss/auth-angular v0.0.3

Weekly downloads
1
License
-
Repository
-
Last release
7 years ago

@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

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago