UNPKG

innotec-auth-plugin

Version:

The Innotec-Auth-Plugin is designed to handle all authentication processes for applications where's conntected to the innotec v2 infrastructure. Theses plugin provides different authentication processes:

56 lines (43 loc) 1.38 kB
import { Injectable, Inject } from '@angular/core'; import { Observable } from 'rxjs/Observable'; @Injectable() export class ModuleOptions { options: any = { companylogo: 'https://werbasinnotec.com/wp-content/uploads/2016/12/Werbas-innoteclogo_small.svg', endpoint: 'https://api.v2.werbasinnotec.com/auth', userregisterurl: 'https://myaccount.v2.werbasinnotec.com/register', closeable: true } constructor() { } public get() { this.options.redirect_uri = window.location.origin; return this.options; } public set(obj: any) { if (obj.companylogo) { this.options.companylogo = obj.companylogo; } if (obj.clientid) { this.options.clientid = obj.clientid; } if (obj.clientsecret) { this.options.clientsecret = obj.clientsecret; } if (!obj.endpoint || obj.endpoint === 'live') { this.options.endpoint = 'https://api.v2.werbasinnotec.com/auth'; } if (!obj.endpoint || obj.endpoint === 'dev') { this.options.endpoint = 'https://api.dev.v2.werbasinnotec.com/auth'; } if (obj.facebook_clientid) { this.options.facebook_clientid = obj.facebook_clientid; } if (obj.google_clientid) { this.options.google_clientid = obj.google_clientid; } if (obj.paypal_clientid) { this.options.paypal_clientid = obj.paypal_clientid; } } }