feat: update app version and build details; refactor auth service and components for improved functionality
This commit is contained in:
@@ -25,13 +25,13 @@
|
||||
<!-- [ngStyle]="{ transform: 'scale(1.' + pullDistance() * 10 + ')' }" -->
|
||||
</div>
|
||||
}
|
||||
@if (isAuth()) {
|
||||
<!-- @if (isAuth()) {
|
||||
@defer (when isAuth()) {
|
||||
<router-outlet></router-outlet>
|
||||
}
|
||||
} @else {
|
||||
<pos-pages-layout />
|
||||
}
|
||||
} @else { -->
|
||||
<pos-pages-layout />
|
||||
<!-- } -->
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
export * from './routes/index';
|
||||
@@ -0,0 +1,19 @@
|
||||
import { NamedRoutes } from '@/core';
|
||||
import { Routes } from '@angular/router';
|
||||
|
||||
export type TPosAuthRouteNames = 'login';
|
||||
|
||||
const baseRoute = `auth`;
|
||||
|
||||
export const posAuthNamedRoutes: NamedRoutes<TPosAuthRouteNames> = {
|
||||
login: {
|
||||
path: 'auth',
|
||||
loadComponent: () => import('../../views/auth.component').then((m) => m.PosAuthComponent),
|
||||
meta: {
|
||||
title: 'ورود',
|
||||
pagePath: () => baseRoute,
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export const POS_AUTH_ROUTES: Routes = [posAuthNamedRoutes.login];
|
||||
@@ -0,0 +1 @@
|
||||
<app-auth (onSubmit)="onLoggedIn($event)" />
|
||||
@@ -0,0 +1,18 @@
|
||||
import { AuthComponent } from '@/modules/auth/pages/auth.component';
|
||||
import { Component, inject } from '@angular/core';
|
||||
import { Router } from '@angular/router';
|
||||
|
||||
@Component({
|
||||
selector: 'pos-auth',
|
||||
templateUrl: 'auth.component.html',
|
||||
imports: [AuthComponent],
|
||||
})
|
||||
export class PosAuthComponent {
|
||||
private readonly router = inject(Router);
|
||||
|
||||
onLoggedIn(isReady: boolean) {
|
||||
if (isReady) {
|
||||
this.router.navigateByUrl('/');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user