|
|
@ -84,8 +84,8 @@ export class AppComponent implements OnInit, AfterViewInit {
|
|
|
|
this.postsService.open_create_default_admin_dialog.subscribe(open => {
|
|
|
|
this.postsService.open_create_default_admin_dialog.subscribe(open => {
|
|
|
|
if (open) {
|
|
|
|
if (open) {
|
|
|
|
const dialogRef = this.dialog.open(SetDefaultAdminDialogComponent);
|
|
|
|
const dialogRef = this.dialog.open(SetDefaultAdminDialogComponent);
|
|
|
|
dialogRef.afterClosed().subscribe(success => {
|
|
|
|
dialogRef.afterClosed().subscribe(res => {
|
|
|
|
if (success) {
|
|
|
|
if (!res || !res['user']) {
|
|
|
|
if (this.router.url !== '/login') { this.router.navigate(['/login']); }
|
|
|
|
if (this.router.url !== '/login') { this.router.navigate(['/login']); }
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
console.error('Failed to create default admin account. See logs for details.');
|
|
|
|
console.error('Failed to create default admin account. See logs for details.');
|
|
|
|