@dbg-riskit/angular-login 12.3.0 → 13.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dbg-riskit-angular-login.d.ts +1 -0
- package/docs/README.md +1 -11
- package/{esm2015/dbg-riskit-angular-login.js → esm2020/dbg-riskit-angular-login.mjs} +0 -0
- package/esm2020/lib/login.component.mjs +80 -0
- package/esm2020/lib/login.menu.component.mjs +83 -0
- package/esm2020/lib/login.module.mjs +53 -0
- package/{esm2015/public_api.js → esm2020/public_api.mjs} +0 -0
- package/fesm2015/dbg-riskit-angular-login.mjs +212 -0
- package/fesm2015/dbg-riskit-angular-login.mjs.map +1 -0
- package/fesm2020/dbg-riskit-angular-login.mjs +208 -0
- package/fesm2020/dbg-riskit-angular-login.mjs.map +1 -0
- package/lib/login.component.d.ts +3 -0
- package/lib/login.menu.component.d.ts +9 -2
- package/lib/login.module.d.ts +11 -0
- package/package.json +28 -16
- package/bundles/dbg-riskit-angular-login.umd.js +0 -545
- package/bundles/dbg-riskit-angular-login.umd.js.map +0 -1
- package/dbg-riskit-angular-login.metadata.json +0 -1
- package/esm2015/lib/login.component.js +0 -73
- package/esm2015/lib/login.menu.component.js +0 -75
- package/esm2015/lib/login.module.js +0 -33
- package/fesm2015/dbg-riskit-angular-login.js +0 -178
- package/fesm2015/dbg-riskit-angular-login.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dbg-riskit-angular-login.mjs","sources":["../../../../pkg/dbg-riskit/angular-login/src/lib/login.component.ts","../../../../pkg/dbg-riskit/angular-login/src/lib/login.component.html","../../../../pkg/dbg-riskit/angular-login/src/lib/login.menu.component.ts","../../../../pkg/dbg-riskit/angular-login/src/lib/login.menu.component.html","../../../../pkg/dbg-riskit/angular-login/src/lib/login.module.ts","../../../../pkg/dbg-riskit/angular-login/src/dbg-riskit-angular-login.ts"],"sourcesContent":["import {AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject} from '@angular/core';\n\nimport {AuthRoutingFlowService} from '@dbg-riskit/angular-auth';\nimport {AUTH_PROVIDER, SECONDARY_LOGO} from '@dbg-riskit/angular-common';\nimport {ErrorTypes, toErrorMessage} from '@dbg-riskit/angular-error';\nimport {BaseComponent} from '@dbg-riskit/angular-view';\nimport {AuthProvider, UserInfo} from '@dbg-riskit/common';\n\nimport {Observable} from 'rxjs';\nimport {first, takeUntil} from 'rxjs/operators';\n\n@Component({\n templateUrl : 'login.component.html',\n styleUrls : [\n '../../../component.scss',\n 'login.component.scss'\n ],\n host : {\n '[class.risk-login-form]': 'true'\n },\n changeDetection : ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false\n})\nexport class LoginComponent extends BaseComponent implements AfterViewInit {\n\n /**\n * Error message to be displayed.\n */\n public errorMessage?: string;\n\n /**\n * User name binding.\n */\n public username?: string;\n\n /**\n * Password binding.\n */\n public password?: string;\n\n /**\n * Control for \"login button-to-spinner\".\n */\n public loggingIn = false;\n\n public constructor(@Inject(AUTH_PROVIDER) private readonly authProvider: AuthProvider,\n private readonly changeDetectorRef: ChangeDetectorRef,\n private readonly authRoutingFlowService: AuthRoutingFlowService,\n @Inject(SECONDARY_LOGO) private readonly secondaryLogo: string) {\n super();\n // Update component state on login status change\n this.authProvider.loggedInStream.pipe(\n takeUntil(this.destroyed)\n ).subscribe(() => this.changeDetectorRef.markForCheck());\n }\n\n public ngAfterViewInit(): void {\n this.authRoutingFlowService.loginViaService().pipe(\n takeUntil(this.destroyed)\n ).subscribe(\n () => {\n this.changeDetectorRef.markForCheck();\n },\n (err: ErrorTypes) => {\n this.errorMessage = toErrorMessage(err).message;\n this.changeDetectorRef.markForCheck();\n }\n );\n }\n\n public get isDirectFlow(): boolean {\n return this.authRoutingFlowService.directFlow;\n }\n\n public get authStatus(): Observable<boolean> {\n return this.authProvider.loggedIn;\n }\n\n public get userProfile(): Observable<UserInfo | undefined> {\n return this.authProvider.userProfile;\n }\n\n public login(): void {\n this.loggingIn = true;\n this.authRoutingFlowService.login(this.username, this.password).pipe(\n first()\n ).subscribe(\n (res: boolean) => {\n if (!res) {\n this.errorMessage = 'Authentication failed. Server did not generate a token.';\n }\n this.loggingIn = false;\n this.changeDetectorRef.markForCheck();\n },\n () => {\n this.loggingIn = false;\n this.errorMessage = 'Authentication failed. Is the username and password correct?';\n this.changeDetectorRef.markForCheck();\n }\n );\n }\n\n public get logo(): string {\n return this.secondaryLogo;\n }\n}\n","<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Directive,\n HostBinding,\n Inject,\n Input\n} from '@angular/core';\n\nimport {AuthRoutingFlowService} from '@dbg-riskit/angular-auth';\nimport {AUTH_PROVIDER} from '@dbg-riskit/angular-common';\nimport {BaseComponent} from '@dbg-riskit/angular-view';\nimport {AuthProvider} from '@dbg-riskit/common';\n\nimport {Observable} from 'rxjs';\nimport {first, takeUntil} from 'rxjs/operators';\n\n@Directive({\n selector: 'risk-login-menu-title-horizontal, '\n + 'risk-login-menu-title-vertical',\n host : {\n '[class.risk-login-menu-title]': 'true'\n }\n})\nexport class LoginMenuComponentTitleDirective {\n}\n\n@Directive({\n selector: 'risk-login-menu-before-items-horizontal,'\n + ' risk-login-menu-before-items-vertical,'\n + 'risk-login-menu-after-items-horizontal,'\n + 'risk-login-menu-after-items-vertical'\n})\nexport class LoginMenuItemsDirective {\n}\n\n@Component({\n selector : 'risk-login-menu',\n templateUrl : 'login.menu.component.html',\n styleUrls : [\n '../../../component.scss',\n 'login.menu.component.scss'\n ],\n host : {\n '[class.risk-login-menu]': 'true'\n },\n changeDetection : ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false\n})\nexport class LoginMenuComponent extends BaseComponent {\n\n @Input()\n public orientation: 'row' | 'column' = 'row';\n\n @HostBinding('class.risk-login-menu-flex-row')\n public get isRow(): boolean {\n return this.orientation === 'row';\n }\n\n @HostBinding('class.risk-login-menu-flex-column')\n public get isColumn(): boolean {\n return this.orientation === 'column';\n }\n\n public constructor(@Inject(AUTH_PROVIDER) private readonly authProvider: AuthProvider,\n private readonly authRoutingFlowService: AuthRoutingFlowService,\n private readonly changeDetectorRef: ChangeDetectorRef) {\n super();\n\n // Update menu state on login status change\n this.authProvider.loggedInStream.pipe(\n takeUntil(this.destroyed)\n ).subscribe(() => this.changeDetectorRef.markForCheck());\n }\n\n public menuClosed(): void {\n this.changeDetectorRef.markForCheck();\n }\n\n public get authStatus(): Observable<boolean> {\n return this.authProvider.loggedIn;\n }\n\n public logout(): void {\n this.authRoutingFlowService.logout().pipe(\n first()\n ).subscribe();\n }\n}\n","<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {RouterModule} from '@angular/router';\nimport {AuthModule} from '@dbg-riskit/angular-auth';\nimport {CommonViewModule} from '@dbg-riskit/angular-view';\nimport {LoginComponent} from './login.component';\nimport {LoginMenuComponent, LoginMenuComponentTitleDirective, LoginMenuItemsDirective} from './login.menu.component';\n\n@NgModule({\n imports : [\n CommonModule,\n FormsModule,\n RouterModule,\n AuthModule,\n CommonViewModule\n ],\n declarations: [\n LoginMenuComponent,\n LoginComponent,\n LoginMenuComponentTitleDirective,\n LoginMenuItemsDirective\n ],\n exports : [\n LoginMenuComponent,\n LoginMenuComponentTitleDirective,\n LoginMenuItemsDirective\n ]\n})\nexport class LoginModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAuBa,uBAAuB,aAAa;IAsB7C,YAA2D,YAA0B,EACjD,iBAAoC,EACpC,sBAA8C,EACtB,aAAqB;QAC7E,KAAK,EAAE,CAAC;QAJ+C,iBAAY,GAAZ,YAAY,CAAc;QACjD,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,2BAAsB,GAAtB,sBAAsB,CAAwB;QACtB,kBAAa,GAAb,aAAa,CAAQ;;;;QAL1E,cAAS,GAAG,KAAK,CAAC;;QAQrB,IAAI,CAAC,YAAY,CAAC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BACJ;;;AC5BD;;;;;;"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import * as i8 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Component, ChangeDetectionStrategy, Inject, Directive, Input, HostBinding, NgModule } from '@angular/core';
|
|
5
|
+
import * as i9 from '@angular/forms';
|
|
6
|
+
import { FormsModule } from '@angular/forms';
|
|
7
|
+
import { RouterModule } from '@angular/router';
|
|
8
|
+
import * as i1 from '@dbg-riskit/angular-auth';
|
|
9
|
+
import { AuthModule } from '@dbg-riskit/angular-auth';
|
|
10
|
+
import * as i2 from '@dbg-riskit/angular-view';
|
|
11
|
+
import { BaseComponent, CommonViewModule } from '@dbg-riskit/angular-view';
|
|
12
|
+
import { AUTH_PROVIDER, SECONDARY_LOGO } from '@dbg-riskit/angular-common';
|
|
13
|
+
import { toErrorMessage } from '@dbg-riskit/angular-error';
|
|
14
|
+
import { takeUntil, first } from 'rxjs/operators';
|
|
15
|
+
import * as i3 from '@angular/material/card';
|
|
16
|
+
import * as i4 from '@angular/material/form-field';
|
|
17
|
+
import * as i4$1 from '@angular/material/button';
|
|
18
|
+
import * as i6 from '@angular/material/progress-spinner';
|
|
19
|
+
import * as i7 from '@angular/material/icon';
|
|
20
|
+
import * as i10 from '@angular/material/input';
|
|
21
|
+
import * as i2$1 from '@angular/material/menu';
|
|
22
|
+
|
|
23
|
+
class LoginComponent extends BaseComponent {
|
|
24
|
+
constructor(authProvider, changeDetectorRef, authRoutingFlowService, secondaryLogo) {
|
|
25
|
+
super();
|
|
26
|
+
this.authProvider = authProvider;
|
|
27
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
28
|
+
this.authRoutingFlowService = authRoutingFlowService;
|
|
29
|
+
this.secondaryLogo = secondaryLogo;
|
|
30
|
+
/**
|
|
31
|
+
* Control for "login button-to-spinner".
|
|
32
|
+
*/
|
|
33
|
+
this.loggingIn = false;
|
|
34
|
+
// Update component state on login status change
|
|
35
|
+
this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
|
|
36
|
+
}
|
|
37
|
+
ngAfterViewInit() {
|
|
38
|
+
this.authRoutingFlowService.loginViaService().pipe(takeUntil(this.destroyed)).subscribe(() => {
|
|
39
|
+
this.changeDetectorRef.markForCheck();
|
|
40
|
+
}, (err) => {
|
|
41
|
+
this.errorMessage = toErrorMessage(err).message;
|
|
42
|
+
this.changeDetectorRef.markForCheck();
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
get isDirectFlow() {
|
|
46
|
+
return this.authRoutingFlowService.directFlow;
|
|
47
|
+
}
|
|
48
|
+
get authStatus() {
|
|
49
|
+
return this.authProvider.loggedIn;
|
|
50
|
+
}
|
|
51
|
+
get userProfile() {
|
|
52
|
+
return this.authProvider.userProfile;
|
|
53
|
+
}
|
|
54
|
+
login() {
|
|
55
|
+
this.loggingIn = true;
|
|
56
|
+
this.authRoutingFlowService.login(this.username, this.password).pipe(first()).subscribe((res) => {
|
|
57
|
+
if (!res) {
|
|
58
|
+
this.errorMessage = 'Authentication failed. Server did not generate a token.';
|
|
59
|
+
}
|
|
60
|
+
this.loggingIn = false;
|
|
61
|
+
this.changeDetectorRef.markForCheck();
|
|
62
|
+
}, () => {
|
|
63
|
+
this.loggingIn = false;
|
|
64
|
+
this.errorMessage = 'Authentication failed. Is the username and password correct?';
|
|
65
|
+
this.changeDetectorRef.markForCheck();
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
get logo() {
|
|
69
|
+
return this.secondaryLogo;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
LoginComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginComponent, deps: [{ token: AUTH_PROVIDER }, { token: i0.ChangeDetectorRef }, { token: i1.AuthRoutingFlowService }, { token: SECONDARY_LOGO }], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
+
LoginComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: LoginComponent, selector: "ng-component", host: { properties: { "class.risk-login-form": "true" } }, usesInheritance: true, ngImport: i0, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-card-title-group{margin:0}.mat-card-title-group .mat-card-title{font-weight:500}.mat-card-actions{margin:0;margin-bottom:-8px!important;padding:0}.mat-card-actions img{float:right;margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:-webkit-flex;display:flex}.risk-login-form-flex-wrapper>div{-webkit-flex:1;flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"], components: [{ type: i2.FlexComponent, selector: "risk-flex", inputs: ["wrapContent"] }, { type: i2.FlexSpacerComponent, selector: "risk-flex-spacer" }, { type: i2.MessageComponent, selector: "risk-error, risk-good, risk-info, risk-message, risk-warn, risk-initial-load, risk-no-data, risk-update-failed", inputs: ["message"] }, { type: i3.MatCard, selector: "mat-card", exportAs: ["matCard"] }, { type: i3.MatCardTitleGroup, selector: "mat-card-title-group" }, { type: i4.MatFormField, selector: "mat-form-field", inputs: ["color", "appearance", "hideRequiredMarker", "hintLabel", "floatLabel"], exportAs: ["matFormField"] }, { type: i4$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i6.MatSpinner, selector: "mat-spinner", inputs: ["color"] }, { type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], directives: [{ type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i9.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { type: i9.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { type: i9.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { type: i3.MatCardTitle, selector: "mat-card-title, [mat-card-title], [matCardTitle]" }, { type: i3.MatCardContent, selector: "mat-card-content, [mat-card-content], [matCardContent]" }, { type: i10.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { type: i9.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { type: i9.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { type: i9.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { type: i3.MatCardActions, selector: "mat-card-actions", inputs: ["align"], exportAs: ["matCardActions"] }], pipes: { "async": i8.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
74
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginComponent, decorators: [{
|
|
75
|
+
type: Component,
|
|
76
|
+
args: [{ host: {
|
|
77
|
+
'[class.risk-login-form]': 'true'
|
|
78
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ".risk-flex>div{width:400px;max-width:97vw;max-height:70vh;margin-top:40px}.mat-card-title-group{margin:0}.mat-card-title-group .mat-card-title{font-weight:500}.mat-card-actions{margin:0;margin-bottom:-8px!important;padding:0}.mat-card-actions img{float:right;margin:3px 0;height:30px}.risk-login-form-flex-wrapper{display:-webkit-flex;display:flex}.risk-login-form-flex-wrapper>div{-webkit-flex:1;flex:1}.risk-login-form-error{font-size:100px;height:100px;width:100px}h3{text-align:center}input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px white inset}\n"] }]
|
|
79
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
80
|
+
type: Inject,
|
|
81
|
+
args: [AUTH_PROVIDER]
|
|
82
|
+
}] }, { type: i0.ChangeDetectorRef }, { type: i1.AuthRoutingFlowService }, { type: undefined, decorators: [{
|
|
83
|
+
type: Inject,
|
|
84
|
+
args: [SECONDARY_LOGO]
|
|
85
|
+
}] }]; } });
|
|
86
|
+
|
|
87
|
+
class LoginMenuComponentTitleDirective {
|
|
88
|
+
}
|
|
89
|
+
LoginMenuComponentTitleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponentTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
90
|
+
LoginMenuComponentTitleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: LoginMenuComponentTitleDirective, selector: "risk-login-menu-title-horizontal, risk-login-menu-title-vertical", host: { properties: { "class.risk-login-menu-title": "true" } }, ngImport: i0 });
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponentTitleDirective, decorators: [{
|
|
92
|
+
type: Directive,
|
|
93
|
+
args: [{
|
|
94
|
+
selector: 'risk-login-menu-title-horizontal, '
|
|
95
|
+
+ 'risk-login-menu-title-vertical',
|
|
96
|
+
host: {
|
|
97
|
+
'[class.risk-login-menu-title]': 'true'
|
|
98
|
+
}
|
|
99
|
+
}]
|
|
100
|
+
}] });
|
|
101
|
+
class LoginMenuItemsDirective {
|
|
102
|
+
}
|
|
103
|
+
LoginMenuItemsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuItemsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
104
|
+
LoginMenuItemsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.0.2", type: LoginMenuItemsDirective, selector: "risk-login-menu-before-items-horizontal, risk-login-menu-before-items-vertical,risk-login-menu-after-items-horizontal,risk-login-menu-after-items-vertical", ngImport: i0 });
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuItemsDirective, decorators: [{
|
|
106
|
+
type: Directive,
|
|
107
|
+
args: [{
|
|
108
|
+
selector: 'risk-login-menu-before-items-horizontal,'
|
|
109
|
+
+ ' risk-login-menu-before-items-vertical,'
|
|
110
|
+
+ 'risk-login-menu-after-items-horizontal,'
|
|
111
|
+
+ 'risk-login-menu-after-items-vertical'
|
|
112
|
+
}]
|
|
113
|
+
}] });
|
|
114
|
+
class LoginMenuComponent extends BaseComponent {
|
|
115
|
+
constructor(authProvider, authRoutingFlowService, changeDetectorRef) {
|
|
116
|
+
super();
|
|
117
|
+
this.authProvider = authProvider;
|
|
118
|
+
this.authRoutingFlowService = authRoutingFlowService;
|
|
119
|
+
this.changeDetectorRef = changeDetectorRef;
|
|
120
|
+
this.orientation = 'row';
|
|
121
|
+
// Update menu state on login status change
|
|
122
|
+
this.authProvider.loggedInStream.pipe(takeUntil(this.destroyed)).subscribe(() => this.changeDetectorRef.markForCheck());
|
|
123
|
+
}
|
|
124
|
+
get isRow() {
|
|
125
|
+
return this.orientation === 'row';
|
|
126
|
+
}
|
|
127
|
+
get isColumn() {
|
|
128
|
+
return this.orientation === 'column';
|
|
129
|
+
}
|
|
130
|
+
menuClosed() {
|
|
131
|
+
this.changeDetectorRef.markForCheck();
|
|
132
|
+
}
|
|
133
|
+
get authStatus() {
|
|
134
|
+
return this.authProvider.loggedIn;
|
|
135
|
+
}
|
|
136
|
+
logout() {
|
|
137
|
+
this.authRoutingFlowService.logout().pipe(first()).subscribe();
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
LoginMenuComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponent, deps: [{ token: AUTH_PROVIDER }, { token: i1.AuthRoutingFlowService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
141
|
+
LoginMenuComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.0.2", type: LoginMenuComponent, selector: "risk-login-menu", inputs: { orientation: "orientation" }, host: { properties: { "class.risk-login-menu": "true", "class.risk-login-menu-flex-row": "this.isRow", "class.risk-login-menu-flex-column": "this.isColumn" } }, usesInheritance: true, ngImport: i0, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:-webkit-flex!important;display:flex!important}:host.risk-login-menu-flex-row{-webkit-flex-direction:row;flex-direction:row}:host.risk-login-menu-flex-column{-webkit-flex-direction:column;flex-direction:column}:host .risk-login-menu-title{font-weight:bold;margin:0 5px}\n"], components: [{ type: i2$1.MatMenu, selector: "mat-menu", exportAs: ["matMenu"] }, { type: i2$1.MatMenuItem, selector: "[mat-menu-item]", inputs: ["disabled", "disableRipple", "role"], exportAs: ["matMenuItem"] }, { type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i4$1.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { type: i4$1.MatAnchor, selector: "a[mat-button], a[mat-raised-button], a[mat-icon-button], a[mat-fab], a[mat-mini-fab], a[mat-stroked-button], a[mat-flat-button]", inputs: ["disabled", "disableRipple", "color", "tabIndex"], exportAs: ["matButton", "matAnchor"] }], directives: [{ type: i8.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2$1.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", exportAs: ["matMenuTrigger"] }], pipes: { "async": i8.AsyncPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginMenuComponent, decorators: [{
|
|
143
|
+
type: Component,
|
|
144
|
+
args: [{ selector: 'risk-login-menu', host: {
|
|
145
|
+
'[class.risk-login-menu]': 'true'
|
|
146
|
+
}, changeDetection: ChangeDetectionStrategy.OnPush, preserveWhitespaces: false, template: "<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n", styles: [":host{display:block;padding:0;margin:0}:host>*{vertical-align:bottom}\n", ":host{display:-webkit-flex!important;display:flex!important}:host.risk-login-menu-flex-row{-webkit-flex-direction:row;flex-direction:row}:host.risk-login-menu-flex-column{-webkit-flex-direction:column;flex-direction:column}:host .risk-login-menu-title{font-weight:bold;margin:0 5px}\n"] }]
|
|
147
|
+
}], ctorParameters: function () { return [{ type: undefined, decorators: [{
|
|
148
|
+
type: Inject,
|
|
149
|
+
args: [AUTH_PROVIDER]
|
|
150
|
+
}] }, { type: i1.AuthRoutingFlowService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { orientation: [{
|
|
151
|
+
type: Input
|
|
152
|
+
}], isRow: [{
|
|
153
|
+
type: HostBinding,
|
|
154
|
+
args: ['class.risk-login-menu-flex-row']
|
|
155
|
+
}], isColumn: [{
|
|
156
|
+
type: HostBinding,
|
|
157
|
+
args: ['class.risk-login-menu-flex-column']
|
|
158
|
+
}] } });
|
|
159
|
+
|
|
160
|
+
class LoginModule {
|
|
161
|
+
}
|
|
162
|
+
LoginModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
163
|
+
LoginModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, declarations: [LoginMenuComponent,
|
|
164
|
+
LoginComponent,
|
|
165
|
+
LoginMenuComponentTitleDirective,
|
|
166
|
+
LoginMenuItemsDirective], imports: [CommonModule,
|
|
167
|
+
FormsModule,
|
|
168
|
+
RouterModule,
|
|
169
|
+
AuthModule,
|
|
170
|
+
CommonViewModule], exports: [LoginMenuComponent,
|
|
171
|
+
LoginMenuComponentTitleDirective,
|
|
172
|
+
LoginMenuItemsDirective] });
|
|
173
|
+
LoginModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, imports: [[
|
|
174
|
+
CommonModule,
|
|
175
|
+
FormsModule,
|
|
176
|
+
RouterModule,
|
|
177
|
+
AuthModule,
|
|
178
|
+
CommonViewModule
|
|
179
|
+
]] });
|
|
180
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.2", ngImport: i0, type: LoginModule, decorators: [{
|
|
181
|
+
type: NgModule,
|
|
182
|
+
args: [{
|
|
183
|
+
imports: [
|
|
184
|
+
CommonModule,
|
|
185
|
+
FormsModule,
|
|
186
|
+
RouterModule,
|
|
187
|
+
AuthModule,
|
|
188
|
+
CommonViewModule
|
|
189
|
+
],
|
|
190
|
+
declarations: [
|
|
191
|
+
LoginMenuComponent,
|
|
192
|
+
LoginComponent,
|
|
193
|
+
LoginMenuComponentTitleDirective,
|
|
194
|
+
LoginMenuItemsDirective
|
|
195
|
+
],
|
|
196
|
+
exports: [
|
|
197
|
+
LoginMenuComponent,
|
|
198
|
+
LoginMenuComponentTitleDirective,
|
|
199
|
+
LoginMenuItemsDirective
|
|
200
|
+
]
|
|
201
|
+
}]
|
|
202
|
+
}] });
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Generated bundle index. Do not edit.
|
|
206
|
+
*/
|
|
207
|
+
|
|
208
|
+
export { LoginComponent, LoginMenuComponent, LoginMenuComponentTitleDirective, LoginMenuItemsDirective, LoginModule };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dbg-riskit-angular-login.mjs","sources":["../../../../pkg/dbg-riskit/angular-login/src/lib/login.component.ts","../../../../pkg/dbg-riskit/angular-login/src/lib/login.component.html","../../../../pkg/dbg-riskit/angular-login/src/lib/login.menu.component.ts","../../../../pkg/dbg-riskit/angular-login/src/lib/login.menu.component.html","../../../../pkg/dbg-riskit/angular-login/src/lib/login.module.ts","../../../../pkg/dbg-riskit/angular-login/src/dbg-riskit-angular-login.ts"],"sourcesContent":["import {AfterViewInit, ChangeDetectionStrategy, ChangeDetectorRef, Component, Inject} from '@angular/core';\n\nimport {AuthRoutingFlowService} from '@dbg-riskit/angular-auth';\nimport {AUTH_PROVIDER, SECONDARY_LOGO} from '@dbg-riskit/angular-common';\nimport {ErrorTypes, toErrorMessage} from '@dbg-riskit/angular-error';\nimport {BaseComponent} from '@dbg-riskit/angular-view';\nimport {AuthProvider, UserInfo} from '@dbg-riskit/common';\n\nimport {Observable} from 'rxjs';\nimport {first, takeUntil} from 'rxjs/operators';\n\n@Component({\n templateUrl : 'login.component.html',\n styleUrls : [\n '../../../component.scss',\n 'login.component.scss'\n ],\n host : {\n '[class.risk-login-form]': 'true'\n },\n changeDetection : ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false\n})\nexport class LoginComponent extends BaseComponent implements AfterViewInit {\n\n /**\n * Error message to be displayed.\n */\n public errorMessage?: string;\n\n /**\n * User name binding.\n */\n public username?: string;\n\n /**\n * Password binding.\n */\n public password?: string;\n\n /**\n * Control for \"login button-to-spinner\".\n */\n public loggingIn = false;\n\n public constructor(@Inject(AUTH_PROVIDER) private readonly authProvider: AuthProvider,\n private readonly changeDetectorRef: ChangeDetectorRef,\n private readonly authRoutingFlowService: AuthRoutingFlowService,\n @Inject(SECONDARY_LOGO) private readonly secondaryLogo: string) {\n super();\n // Update component state on login status change\n this.authProvider.loggedInStream.pipe(\n takeUntil(this.destroyed)\n ).subscribe(() => this.changeDetectorRef.markForCheck());\n }\n\n public ngAfterViewInit(): void {\n this.authRoutingFlowService.loginViaService().pipe(\n takeUntil(this.destroyed)\n ).subscribe(\n () => {\n this.changeDetectorRef.markForCheck();\n },\n (err: ErrorTypes) => {\n this.errorMessage = toErrorMessage(err).message;\n this.changeDetectorRef.markForCheck();\n }\n );\n }\n\n public get isDirectFlow(): boolean {\n return this.authRoutingFlowService.directFlow;\n }\n\n public get authStatus(): Observable<boolean> {\n return this.authProvider.loggedIn;\n }\n\n public get userProfile(): Observable<UserInfo | undefined> {\n return this.authProvider.userProfile;\n }\n\n public login(): void {\n this.loggingIn = true;\n this.authRoutingFlowService.login(this.username, this.password).pipe(\n first()\n ).subscribe(\n (res: boolean) => {\n if (!res) {\n this.errorMessage = 'Authentication failed. Server did not generate a token.';\n }\n this.loggingIn = false;\n this.changeDetectorRef.markForCheck();\n },\n () => {\n this.loggingIn = false;\n this.errorMessage = 'Authentication failed. Is the username and password correct?';\n this.changeDetectorRef.markForCheck();\n }\n );\n }\n\n public get logo(): string {\n return this.secondaryLogo;\n }\n}\n","<risk-flex>\n <risk-flex-spacer></risk-flex-spacer>\n\n <div *ngIf=\"isDirectFlow\">\n <ng-template #loggedOut>\n <risk-error *ngIf=\"errorMessage\" [message]=\"errorMessage\"></risk-error>\n\n <form (ngSubmit)=\"login()\" role=\"form\">\n <mat-card>\n <mat-card-title-group>\n <mat-card-title>Please Sign In</mat-card-title>\n </mat-card-title-group>\n <mat-card-content>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"text\"\n placeholder=\"Username\"\n name=\"username\"\n [(ngModel)]=\"username\"\n autofocus>\n </mat-form-field>\n <mat-form-field class=\"risk-full-width\">\n <input matInput\n type=\"password\"\n placeholder=\"Password\"\n name=\"password\"\n [(ngModel)]=\"password\">\n </mat-form-field>\n </mat-card-content>\n <mat-card-actions>\n <button *ngIf=\"!loggingIn\"\n mat-raised-button\n color=\"primary\"\n type=\"submit\">\n Sign in\n </button>\n <img [src]=\"logo\" alt=\"Company logo\">\n <mat-spinner *ngIf=\"loggingIn\" [diameter]=\"36\"></mat-spinner>\n </mat-card-actions>\n </mat-card>\n </form>\n </ng-template>\n\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <ng-template [ngIf]=\"userProfile | async\" let-user=\"ngIf\">\n <risk-good *ngIf=\"user?.name\"\n [message]=\"'Successfully logged in as ' + user.name + '.'\"></risk-good>\n <risk-good *ngIf=\"!user && !user.name\"\n [message]=\"'Successfully logged in!'\"></risk-good>\n </ng-template>\n </ng-template>\n </div>\n\n <div *ngIf=\"!isDirectFlow\">\n <ng-template [ngIf]=\"!errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-spinner></mat-spinner>\n <div></div>\n </div>\n <h3>Contacting authentication server...</h3>\n </ng-template>\n <ng-template [ngIf]=\"errorMessage\">\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <mat-icon class=\"risk-login-form-error\" color=\"warn\">error_outline</mat-icon>\n <div></div>\n </div>\n <h3>Failed to authenticate user: {{errorMessage}}</h3>\n <div class=\"risk-login-form-flex-wrapper\">\n <div></div>\n <button mat-button\n (click)=\"login()\"\n color=\"primary\"\n type=\"button\">\n <mat-icon>autorenew</mat-icon>\n Retry\n </button>\n <div></div>\n </div>\n </ng-template>\n </div>\n\n <risk-flex-spacer></risk-flex-spacer>\n</risk-flex>\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Directive,\n HostBinding,\n Inject,\n Input\n} from '@angular/core';\n\nimport {AuthRoutingFlowService} from '@dbg-riskit/angular-auth';\nimport {AUTH_PROVIDER} from '@dbg-riskit/angular-common';\nimport {BaseComponent} from '@dbg-riskit/angular-view';\nimport {AuthProvider} from '@dbg-riskit/common';\n\nimport {Observable} from 'rxjs';\nimport {first, takeUntil} from 'rxjs/operators';\n\n@Directive({\n selector: 'risk-login-menu-title-horizontal, '\n + 'risk-login-menu-title-vertical',\n host : {\n '[class.risk-login-menu-title]': 'true'\n }\n})\nexport class LoginMenuComponentTitleDirective {\n}\n\n@Directive({\n selector: 'risk-login-menu-before-items-horizontal,'\n + ' risk-login-menu-before-items-vertical,'\n + 'risk-login-menu-after-items-horizontal,'\n + 'risk-login-menu-after-items-vertical'\n})\nexport class LoginMenuItemsDirective {\n}\n\n@Component({\n selector : 'risk-login-menu',\n templateUrl : 'login.menu.component.html',\n styleUrls : [\n '../../../component.scss',\n 'login.menu.component.scss'\n ],\n host : {\n '[class.risk-login-menu]': 'true'\n },\n changeDetection : ChangeDetectionStrategy.OnPush,\n preserveWhitespaces: false\n})\nexport class LoginMenuComponent extends BaseComponent {\n\n @Input()\n public orientation: 'row' | 'column' = 'row';\n\n @HostBinding('class.risk-login-menu-flex-row')\n public get isRow(): boolean {\n return this.orientation === 'row';\n }\n\n @HostBinding('class.risk-login-menu-flex-column')\n public get isColumn(): boolean {\n return this.orientation === 'column';\n }\n\n public constructor(@Inject(AUTH_PROVIDER) private readonly authProvider: AuthProvider,\n private readonly authRoutingFlowService: AuthRoutingFlowService,\n private readonly changeDetectorRef: ChangeDetectorRef) {\n super();\n\n // Update menu state on login status change\n this.authProvider.loggedInStream.pipe(\n takeUntil(this.destroyed)\n ).subscribe(() => this.changeDetectorRef.markForCheck());\n }\n\n public menuClosed(): void {\n this.changeDetectorRef.markForCheck();\n }\n\n public get authStatus(): Observable<boolean> {\n return this.authProvider.loggedIn;\n }\n\n public logout(): void {\n this.authRoutingFlowService.logout().pipe(\n first()\n ).subscribe();\n }\n}\n","<ng-template [ngIf]=\"orientation === 'row'\">\n <mat-menu #loginMenu=\"matMenu\"\n [overlapTrigger]=\"false\">\n <ng-content select=\"risk-login-menu-before-items-horizontal\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut\">\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </button>\n </ng-template>\n <ng-template #loggedOut>\n <button mat-menu-item\n (click)=\"logout()\"\n type=\"button\">\n <mat-icon>launch</mat-icon>\n Login\n </button>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-horizontal\"></ng-content>\n </mat-menu>\n <button mat-button\n #menu=\"matMenuTrigger\"\n [matMenuTriggerFor]=\"loginMenu\"\n [class.risk-menu-open]=\"menu.menuOpen\"\n (onMenuClose)=\"menuClosed()\"\n type=\"button\">\n <ng-content select=\"risk-login-menu-title-horizontal\"></ng-content>\n <mat-icon>person</mat-icon>\n </button>\n</ng-template>\n\n<ng-template [ngIf]=\"orientation === 'column'\">\n <ng-content select=\"risk-login-menu-title-vertical\"></ng-content>\n <ng-content select=\"risk-login-menu-before-items-vertical\"></ng-content>\n <ng-template [ngIf]=\"authStatus | async\" [ngIfElse]=\"loggedOut2\">\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>exit_to_app</mat-icon>\n Logout\n </a>\n </ng-template>\n <ng-template #loggedOut2>\n <a mat-button\n (click)=\"logout()\">\n <mat-icon>launch</mat-icon>\n Login\n </a>\n </ng-template>\n <ng-content select=\"risk-login-menu-after-items-vertical\"></ng-content>\n</ng-template>\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {FormsModule} from '@angular/forms';\nimport {RouterModule} from '@angular/router';\nimport {AuthModule} from '@dbg-riskit/angular-auth';\nimport {CommonViewModule} from '@dbg-riskit/angular-view';\nimport {LoginComponent} from './login.component';\nimport {LoginMenuComponent, LoginMenuComponentTitleDirective, LoginMenuItemsDirective} from './login.menu.component';\n\n@NgModule({\n imports : [\n CommonModule,\n FormsModule,\n RouterModule,\n AuthModule,\n CommonViewModule\n ],\n declarations: [\n LoginMenuComponent,\n LoginComponent,\n LoginMenuComponentTitleDirective,\n LoginMenuItemsDirective\n ],\n exports : [\n LoginMenuComponent,\n LoginMenuComponentTitleDirective,\n LoginMenuItemsDirective\n ]\n})\nexport class LoginModule {\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;MAuBa,cAAe,SAAQ,aAAa;IAsB7C,YAA2D,YAA0B,EACjD,iBAAoC,EACpC,sBAA8C,EACtB,aAAqB;QAC7E,KAAK,EAAE,CAAC;QAJ+C,iBAAY,GAAZ,YAAY,CAAc;QACjD,sBAAiB,GAAjB,iBAAiB,CAAmB;QACpC,2BAAsB,GAAtB,sBAAsB,CAAwB;QACtB,kBAAa,GAAb,aAAa,CAAQ;;;;QAL1E,cAAS,GAAG,KAAK,CAAC;;QAQrB,IAAI,CAAC,YAAY,CAAC,cAAc,CAAC,IAAI,CACjC,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAC5B,CAAC,SAAS,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,CAAC,CAAC;KAC5D;IAEM,eAAe;QAClB,IAAI,CAAC,sBAAsB,CAAC,eAAe,EAAE,CAAC,IAAI,CAC9C,SAAS,CAAC,IAAI,CAAC,SAAS,CAAC,CAC5B,CAAC,SAAS,CACP;YACI,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,CAAC;SACzC,EACD,CAAC,GAAe;YACZ,IAAI,CAAC,YAAY,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC;YAChD,IAAI,CAAC,iBAAiB,CAAC,YAAY,EAAE,CAAC;SACzC,CACJ,CAAC;KACL;IAED,IAAW,YAAY;QACnB,OAAO,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC;KACjD;IAED,IAAW,UAAU;QACjB,OAAO,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC;KACrC;IAED,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,YAAY,CAAC,WAAW,C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kBAAkB;QAClB,cAAc;QACd,gCAAgC;QAChC,uBAAuB,aAVvB,YAAY;QACZ,WAAW;QACX,YAAY;QACZ,UAAU;QACV,gBAAgB,aAShB,kBAAkB;QAClB,gCAAgC;QAChC,uBAAuB;yGAGlB,WAAW,YAnBN;YACV,YAAY;YACZ,WAAW;YACX,YAAY;YACZ,UAAU;YACV,gBAAgB;SACnB;2FAaQ,WAAW;kBApBvB,QAAQ;mBAAC;oBACN,OAAO,EAAO;wBACV,YAAY;wBACZ,WAAW;wBACX,YAAY;wBACZ,UAAU;wBACV,gBAAgB;qBACnB;oBACD,YAAY,EAAE;wBACV,kBAAkB;wBAClB,cAAc;wBACd,gCAAgC;wBAChC,uBAAuB;qBAC1B;oBACD,OAAO,EAAO;wBACV,kBAAkB;wBAClB,gCAAgC;wBAChC,uBAAuB;qBAC1B;iBACJ;;;AC5BD;;;;;;"}
|
package/lib/login.component.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { AuthRoutingFlowService } from '@dbg-riskit/angular-auth';
|
|
|
3
3
|
import { BaseComponent } from '@dbg-riskit/angular-view';
|
|
4
4
|
import { AuthProvider, UserInfo } from '@dbg-riskit/common';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
6
7
|
export declare class LoginComponent extends BaseComponent implements AfterViewInit {
|
|
7
8
|
private readonly authProvider;
|
|
8
9
|
private readonly changeDetectorRef;
|
|
@@ -31,4 +32,6 @@ export declare class LoginComponent extends BaseComponent implements AfterViewIn
|
|
|
31
32
|
get userProfile(): Observable<UserInfo | undefined>;
|
|
32
33
|
login(): void;
|
|
33
34
|
get logo(): string;
|
|
35
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LoginComponent, never>;
|
|
36
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LoginComponent, "ng-component", never, {}, {}, never, never>;
|
|
34
37
|
}
|
|
@@ -3,9 +3,14 @@ import { AuthRoutingFlowService } from '@dbg-riskit/angular-auth';
|
|
|
3
3
|
import { BaseComponent } from '@dbg-riskit/angular-view';
|
|
4
4
|
import { AuthProvider } from '@dbg-riskit/common';
|
|
5
5
|
import { Observable } from 'rxjs';
|
|
6
|
-
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class LoginMenuComponentTitleDirective {
|
|
8
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LoginMenuComponentTitleDirective, never>;
|
|
9
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LoginMenuComponentTitleDirective, "risk-login-menu-title-horizontal, risk-login-menu-title-vertical", never, {}, {}, never>;
|
|
7
10
|
}
|
|
8
|
-
export declare class
|
|
11
|
+
export declare class LoginMenuItemsDirective {
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LoginMenuItemsDirective, never>;
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<LoginMenuItemsDirective, "risk-login-menu-before-items-horizontal, risk-login-menu-before-items-vertical,risk-login-menu-after-items-horizontal,risk-login-menu-after-items-vertical", never, {}, {}, never>;
|
|
9
14
|
}
|
|
10
15
|
export declare class LoginMenuComponent extends BaseComponent {
|
|
11
16
|
private readonly authProvider;
|
|
@@ -18,4 +23,6 @@ export declare class LoginMenuComponent extends BaseComponent {
|
|
|
18
23
|
menuClosed(): void;
|
|
19
24
|
get authStatus(): Observable<boolean>;
|
|
20
25
|
logout(): void;
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LoginMenuComponent, never>;
|
|
27
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<LoginMenuComponent, "risk-login-menu", never, { "orientation": "orientation"; }, {}, never, ["risk-login-menu-before-items-horizontal", "risk-login-menu-after-items-horizontal", "risk-login-menu-title-horizontal", "risk-login-menu-title-vertical", "risk-login-menu-before-items-vertical", "risk-login-menu-after-items-vertical"]>;
|
|
21
28
|
}
|
package/lib/login.module.d.ts
CHANGED
|
@@ -1,2 +1,13 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./login.menu.component";
|
|
3
|
+
import * as i2 from "./login.component";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "@angular/forms";
|
|
6
|
+
import * as i5 from "@angular/router";
|
|
7
|
+
import * as i6 from "@dbg-riskit/angular-auth";
|
|
8
|
+
import * as i7 from "@dbg-riskit/angular-view";
|
|
1
9
|
export declare class LoginModule {
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<LoginModule, never>;
|
|
11
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<LoginModule, [typeof i1.LoginMenuComponent, typeof i2.LoginComponent, typeof i1.LoginMenuComponentTitleDirective, typeof i1.LoginMenuItemsDirective], [typeof i3.CommonModule, typeof i4.FormsModule, typeof i5.RouterModule, typeof i6.AuthModule, typeof i7.CommonViewModule], [typeof i1.LoginMenuComponent, typeof i1.LoginMenuComponentTitleDirective, typeof i1.LoginMenuItemsDirective]>;
|
|
12
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<LoginModule>;
|
|
2
13
|
}
|
package/package.json
CHANGED
|
@@ -1,27 +1,39 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dbg-riskit/angular-login",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "13.0.3",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE",
|
|
5
5
|
"peerDependencies": {
|
|
6
|
-
"@angular/core": "^
|
|
7
|
-
"@angular/forms": "^
|
|
8
|
-
"@angular/router": "^
|
|
9
|
-
"@dbg-riskit/common": "~
|
|
10
|
-
"@dbg-riskit/angular-auth": "~
|
|
11
|
-
"@dbg-riskit/angular-common": "~
|
|
12
|
-
"@dbg-riskit/angular-error": "~
|
|
13
|
-
"@dbg-riskit/angular-view": "~
|
|
14
|
-
"rxjs": "~
|
|
6
|
+
"@angular/core": "^13.0.2",
|
|
7
|
+
"@angular/forms": "^13.0.2",
|
|
8
|
+
"@angular/router": "^13.0.2",
|
|
9
|
+
"@dbg-riskit/common": "~13.0.3",
|
|
10
|
+
"@dbg-riskit/angular-auth": "~13.0.3",
|
|
11
|
+
"@dbg-riskit/angular-common": "~13.0.3",
|
|
12
|
+
"@dbg-riskit/angular-error": "~13.0.3",
|
|
13
|
+
"@dbg-riskit/angular-view": "~13.0.3",
|
|
14
|
+
"rxjs": "~7.4.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"tslib": "^2.3.1"
|
|
18
18
|
},
|
|
19
|
-
"
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"fesm2015": "fesm2015/dbg-riskit-angular-login.
|
|
19
|
+
"module": "fesm2015/dbg-riskit-angular-login.mjs",
|
|
20
|
+
"es2020": "fesm2020/dbg-riskit-angular-login.mjs",
|
|
21
|
+
"esm2020": "esm2020/dbg-riskit-angular-login.mjs",
|
|
22
|
+
"fesm2020": "fesm2020/dbg-riskit-angular-login.mjs",
|
|
23
|
+
"fesm2015": "fesm2015/dbg-riskit-angular-login.mjs",
|
|
24
24
|
"typings": "dbg-riskit-angular-login.d.ts",
|
|
25
|
-
"
|
|
25
|
+
"exports": {
|
|
26
|
+
"./package.json": {
|
|
27
|
+
"default": "./package.json"
|
|
28
|
+
},
|
|
29
|
+
".": {
|
|
30
|
+
"types": "./dbg-riskit-angular-login.d.ts",
|
|
31
|
+
"esm2020": "./esm2020/dbg-riskit-angular-login.mjs",
|
|
32
|
+
"es2020": "./fesm2020/dbg-riskit-angular-login.mjs",
|
|
33
|
+
"es2015": "./fesm2015/dbg-riskit-angular-login.mjs",
|
|
34
|
+
"node": "./fesm2015/dbg-riskit-angular-login.mjs",
|
|
35
|
+
"default": "./fesm2020/dbg-riskit-angular-login.mjs"
|
|
36
|
+
}
|
|
37
|
+
},
|
|
26
38
|
"sideEffects": false
|
|
27
39
|
}
|