Bugfix/fix user account creation (#682)

* Fix the user account creation

* Update changelog
This commit is contained in:
Thomas Kaul
2022-02-06 21:40:26 +01:00
committed by GitHub
parent 07656c6a95
commit 82069da4e2
6 changed files with 30 additions and 8 deletions

View File

@@ -6,6 +6,7 @@ import { TokenStorageService } from '@ghostfolio/client/services/token-storage.s
import { InfoItem } from '@ghostfolio/common/interfaces';
import { hasPermission, permissions } from '@ghostfolio/common/permissions';
import { LineChartItem } from '@ghostfolio/ui/line-chart/interfaces/line-chart.interface';
import { Role } from '@prisma/client';
import { format } from 'date-fns';
import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject } from 'rxjs';
@@ -62,19 +63,21 @@ export class RegisterPageComponent implements OnDestroy, OnInit {
this.dataService
.postUser()
.pipe(takeUntil(this.unsubscribeSubject))
.subscribe(({ accessToken, authToken }) => {
this.openShowAccessTokenDialog(accessToken, authToken);
.subscribe(({ accessToken, authToken, role }) => {
this.openShowAccessTokenDialog(accessToken, authToken, role);
});
}
public openShowAccessTokenDialog(
accessToken: string,
authToken: string
authToken: string,
role: Role
): void {
const dialogRef = this.dialog.open(ShowAccessTokenDialog, {
data: {
accessToken,
authToken
authToken,
role
},
disableClose: true,
width: '30rem'

View File

@@ -1,4 +1,9 @@
<h1 mat-dialog-title i18n>Create Account</h1>
<h1 mat-dialog-title>
<span i18n>Create Account</span
><span *ngIf="data.role === 'ADMIN'" class="badge badge-light ml-2"
>{{ data.role }}</span
>
</h1>
<div mat-dialog-content>
<div>
<mat-form-field appearance="outline" class="w-100">