Feature/Improve login dialog (#2124)

* Improve login dialog

* Update changelog

---------

Co-authored-by: Thomas <4159106+dtslvr@users.noreply.github.com>
pull/2158/head
bptrgx 2 years ago committed by GitHub
parent 4857b2e620
commit 2bf4f1237a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ### Changed
- Improved the usability of the login dialog
- Disabled the caching in the health check endpoints for data providers - Disabled the caching in the health check endpoints for data providers
- Improved the content of the Frequently Asked Questions (FAQ) page - Improved the content of the Frequently Asked Questions (FAQ) page
- Upgraded `prisma` from version `4.15.0` to `4.16.2` - Upgraded `prisma` from version `4.15.0` to `4.16.2`

@ -16,6 +16,8 @@ import { TokenStorageService } from '@ghostfolio/client/services/token-storage.s
templateUrl: 'login-with-access-token-dialog.html' templateUrl: 'login-with-access-token-dialog.html'
}) })
export class LoginWithAccessTokenDialog { export class LoginWithAccessTokenDialog {
public isAccessTokenHidden = true;
public constructor( public constructor(
@Inject(MAT_DIALOG_DATA) public data: any, @Inject(MAT_DIALOG_DATA) public data: any,
public dialogRef: MatDialogRef<LoginWithAccessTokenDialog>, public dialogRef: MatDialogRef<LoginWithAccessTokenDialog>,
@ -38,6 +40,12 @@ export class LoginWithAccessTokenDialog {
this.dialogRef.close(); this.dialogRef.close();
} }
public onLoginWithAccessToken() {
if (this.data.accessToken) {
this.dialogRef.close(this.data);
}
}
public async onLoginWithInternetIdentity() { public async onLoginWithInternetIdentity() {
try { try {
const { authToken } = await this.internetIdentityService.login(); const { authToken } = await this.internetIdentityService.login();

@ -6,15 +6,27 @@
<div class="py-3" mat-dialog-content> <div class="py-3" mat-dialog-content>
<div class="align-items-center d-flex flex-column"> <div class="align-items-center d-flex flex-column">
<mat-form-field appearance="outline" class="without-hint w-100"> <form class="w-100" (ngSubmit)="onLoginWithAccessToken()">
<mat-label i18n>Security Token</mat-label> <mat-form-field appearance="outline" class="without-hint w-100">
<textarea <mat-label i18n>Security Token</mat-label>
cdkTextareaAutosize <input
matInput matInput
type="text" name="password"
[(ngModel)]="data.accessToken" [type]="isAccessTokenHidden ? 'password' : 'text'"
></textarea> [(ngModel)]="data.accessToken"
</mat-form-field> />
<button
mat-button
matSuffix
type="button"
(click)="isAccessTokenHidden = !isAccessTokenHidden"
>
<ion-icon
[name]="isAccessTokenHidden ? 'eye-outline' : 'eye-off-outline'"
></ion-icon>
</button>
</mat-form-field>
</form>
<ng-container *ngIf="data.hasPermissionToUseSocialLogin"> <ng-container *ngIf="data.hasPermissionToUseSocialLogin">
<div class="my-3 text-center text-muted" i18n>or</div> <div class="my-3 text-center text-muted" i18n>or</div>
<div class="d-flex flex-column"> <div class="d-flex flex-column">

Loading…
Cancel
Save