Skip to content

Commit e47e02b

Browse files
authored
Merge pull request #91 from Gid733/master
Added fixes for login and HTML templates
2 parents d3e08d4 + 53b9efe commit e47e02b

File tree

3 files changed

+29
-16
lines changed

3 files changed

+29
-16
lines changed

eform-client/src/app/components/auth/auth.component.html

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,25 @@
9292
<div class="panel panel-default top wrapper-top">
9393
<div class="panel-body">
9494
<div class="row">
95-
<div class="col-md-8">
96-
<ng-container *ngIf="googleAuthenticatorModel.psk">
97-
<h3>Add EformApplication to Google Authenticator</h3>
98-
<p>Open Google Authenticator and add EformApplication by scanning the QR Code to the right.</p>
99-
</ng-container>
100-
<h3>Enter the 6 digit code that Google Authenticator generates</h3>
101-
<p *ngIf="googleAuthenticatorModel.psk">
102-
Your PSK: <strong>{{googleAuthenticatorModel.psk}}</strong>
103-
</p>
95+
<div class="col-md-4 col-md-offset-4">
96+
<div class="row">
97+
<div class="col-md-12 col-xs-12">
98+
<ng-container *ngIf="!googleAuthenticatorModel.barcodeUrl">
99+
<img width="100%" src="../../../assets/images/google-auth-image.jpg"/>
100+
</ng-container>
101+
<ng-container *ngIf="googleAuthenticatorModel.psk">
102+
<p class="p-header-wrapper p-font">
103+
Open Google Authenticator and add EformApplication by scanning the QR Code to the right.
104+
</p>
105+
</ng-container>
106+
<p>Enter the 6 digit code that Google Authenticator generates</p>
107+
<p *ngIf="googleAuthenticatorModel.psk">
108+
Your PSK: <strong>{{googleAuthenticatorModel.psk}}</strong>
109+
</p>
110+
</div>
111+
</div>
112+
113+
104114
<form [formGroup]="formGoogleAuth">
105115
<div class="input-group input-group-md">
106116
<span class="input-group-addon lock-addon"><i class="fa fa-unlock-alt"
@@ -117,10 +127,9 @@ <h3>Enter the 6 digit code that Google Authenticator generates</h3>
117127
Back to login
118128
</a>
119129
</div>
120-
<div class="col-md-4">
121-
<ng-container *ngIf="googleAuthenticatorModel.barcodeUrl">
122-
<img width="100%" src="http://qrcode.kaywa.com/img.php?s=4&d={{googleAuthenticatorModel.barcodeUrl || ''}}"/>
123-
</ng-container>
130+
<div class="col-md-4" *ngIf="googleAuthenticatorModel.barcodeUrl">
131+
<img width="100%"
132+
src="http://qrcode.kaywa.com/img.php?s=4&d={{googleAuthenticatorModel.barcodeUrl || ''}}"/>
124133
</div>
125134
</div>
126135
</div>

eform-client/src/app/components/auth/auth.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,13 @@ export class AuthComponent implements OnInit {
4747
// send pre-request
4848
this.authService.loginAndGetGoogleAuthKey(new LoginRequestModel(this.formLogin.getRawValue()))
4949
.subscribe((result) => {
50-
this.googleAuthenticatorModel = result.model;
51-
this.showTwoFactorForm = true;
52-
});
50+
if (result.model) {
51+
this.googleAuthenticatorModel = result.model;
52+
this.showTwoFactorForm = true;
53+
} else {
54+
this.notifyService.error({text: '400 - Bad Request The user name or password is incorrect'});
55+
}
56+
});
5357
} else {
5458
this.authService.login(new LoginRequestModel(this.formLogin.getRawValue()))
5559
.subscribe((result: AuthResponseModel) => {
15.3 KB
Loading

0 commit comments

Comments
 (0)