import { Injectable } from '@angular/core' ; import { Observable } from 'rxjs' ; import { LocalService } from './local.service' ; import { OauthService } from './oauth.service' ; import { SharedService } from './shared.service' ; import { StorageType } from './storage-type.enum' ; @ Injectable ( ) export class AuthService { constructor ( private shared , private local , private oauth ) { } public login < T extends string | object = any > ( user , url ? ) { return this . local . login < T > ( user , url ) ; } public signup < T = any > ( user , url ? ) { return this . local . signup < T > ( user , url ) ; } public logout ( ) { return this . shared . logout ( ) ; } public authenticate < T extends object | string = any > ( name , userData ? ) { return this . oauth . authenticate < T > ( name , userData ) ; } public link < T extends object | string = any > ( name , userData ? ) { return this . oauth . authenticate < T > ( name , userData ) ; } public unlink < T = any > ( provider , url ? ) { return this . oauth . unlink < T > ( provider , url ) ; } public isAuthenticated ( ) { return this . shared . isAuthenticated ( ) ; } public getToken ( ) { return this . shared . getToken ( ) ; } public setToken ( token ) { this . shared . setToken ( token ) ; } public removeToken ( ) { this . shared . removeToken ( ) ; } public getPayload ( ) { return this . shared . getPayload ( ) ; } public setStorageType ( type ) { return this . shared . setStorageType ( type ) ; } public getExpirationDate ( ) { return this . shared . getExpirationDate ( ) ; } }