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:

64 lines (55 loc) 1.61 kB
import { Component, Input, trigger, state, style, transition, animate } from '@angular/core'; import { ModuleOptions } from '../services/moduleoptions/moduleoptions.service'; import { I18nService } from '../services/i18n/i18n.service'; @Component({ selector: 'login-field', templateUrl: './loginfield.component.pug', styleUrls: [ './loginfield.component.sass' ], animations: [ trigger('flipState', [ state('active', style({ transform: 'rotateY(179.9deg)' })), state('inactive', style({ transform: 'rotateY(0)' })), transition('active => inactive', animate('500ms ease-out')), transition('inactive => active', animate('500ms ease-in')) ]) ] }) export class LoginField { myValue: String = 'abc'; innoteclogin: String = 'active'; authproviders: String = 'inactive'; fielddescription: String = this.i18n.get('description.sociallogin'); active: Boolean = false; subscription: any; @Input() set open(open: boolean) { if (open) { this.setActive(); } else { this.setInActive(); } } constructor(private moduleOptions: ModuleOptions, private i18n: I18nService) { } openInnotec() { this.authproviders = 'active'; this.innoteclogin = 'inactive'; this.fielddescription = this.i18n.get('description.innoteclogin'); } openSocial() { this.authproviders = 'inactive'; this.innoteclogin = 'active'; this.fielddescription = this.i18n.get('description.sociallogin'); } setActive() { this.active = true; } setInActive() { this.active = false; } }