Compare commits
2 Commits
1786cc3077
...
b0b3fa72e1
Author | SHA1 | Date |
---|---|---|
Igor Hrenowitsch Propisnov | b0b3fa72e1 | |
Igor Hrenowitsch Propisnov | 635b30d33b |
|
@ -6,8 +6,8 @@ const simpleLayoutRoutes: Routes = [
|
||||||
{
|
{
|
||||||
path: '',
|
path: '',
|
||||||
loadComponent: () =>
|
loadComponent: () =>
|
||||||
import('./pages/register-root/register-root.component').then(
|
import('./pages/welcome-root/welcome-root.component').then(
|
||||||
(m) => m.RegisterRootComponent
|
(m) => m.WelcomeRootComponent
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
import { HttpErrorResponse } from '@angular/common/http';
|
|
||||||
import { Component, OnInit } from '@angular/core';
|
|
||||||
import { Router } from '@angular/router';
|
|
||||||
|
|
||||||
import { SuccessDtoApiModel } from '../../api';
|
|
||||||
import { AuthService } from '../../shared/service';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-foo',
|
|
||||||
standalone: true,
|
|
||||||
providers: [],
|
|
||||||
imports: [],
|
|
||||||
templateUrl: './home-root.component.html',
|
|
||||||
styleUrl: './home-root.component.scss',
|
|
||||||
})
|
|
||||||
export class HomeComponent implements OnInit {
|
|
||||||
public constructor(
|
|
||||||
private readonly authService: AuthService,
|
|
||||||
private readonly router: Router
|
|
||||||
) {}
|
|
||||||
|
|
||||||
public ngOnInit(): void {
|
|
||||||
this.authService.status().subscribe(
|
|
||||||
(response: SuccessDtoApiModel) => {
|
|
||||||
if (response.success) {
|
|
||||||
this.router.navigate(['/dashboard']);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
(error: HttpErrorResponse) => {
|
|
||||||
if (error.status === 401) {
|
|
||||||
this.router.navigate(['welcome'], {
|
|
||||||
queryParams: { login: true },
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -67,11 +67,11 @@ type AuthAction = 'signin' | 'signup';
|
||||||
new ApiConfiguration({ withCredentials: true }),
|
new ApiConfiguration({ withCredentials: true }),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
templateUrl: './register-root.component.html',
|
templateUrl: './welcome-root.component.html',
|
||||||
styleUrl: './register-root.component.scss',
|
styleUrl: './welcome-root.component.scss',
|
||||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||||
})
|
})
|
||||||
export class RegisterRootComponent implements OnInit {
|
export class WelcomeRootComponent implements OnInit {
|
||||||
public dialogBackgroundStyle: { 'background-image': string } | null = null;
|
public dialogBackgroundStyle: { 'background-image': string } | null = null;
|
||||||
public leftBackgroundStyle: { 'background-image': string } | null = null;
|
public leftBackgroundStyle: { 'background-image': string } | null = null;
|
||||||
public rightBackgroundStyle: { 'background-image': string } | null = null;
|
public rightBackgroundStyle: { 'background-image': string } | null = null;
|
Loading…
Reference in New Issue