We'll send you an email with a link to log in
(and automatically create a new account if needed)
diff --git a/app/src/app/shared/auth/data/auth.store.ts b/app/src/app/shared/auth/data/auth.store.ts
index 8a5c71f..39d0a83 100644
--- a/app/src/app/shared/auth/data/auth.store.ts
+++ b/app/src/app/shared/auth/data/auth.store.ts
@@ -10,10 +10,10 @@ import {
withComputed,
withHooks,
withMethods,
+ withProps,
withState,
} from '@ngrx/signals';
import { rxMethod } from '@ngrx/signals/rxjs-interop';
-import { createInjectionToken } from 'ngxtension/create-injection-token';
import { EMPTY, filter, finalize, pipe, shareReplay, switchMap, tap } from 'rxjs';
import { AuthService } from './auth.service';
@@ -117,6 +117,14 @@ export const AuthStore = signalStore(
),
};
}),
+ withProps((store) => ({
+ waitUntilConnected$: toObservable(store.status).pipe(
+ tap((status) => logger.log('waitUntilConnected$ - status =', status)),
+ filter((status) => status === 'connected'),
+ shareReplay(1),
+ ),
+ user$: toObservable(store.user),
+ })),
withHooks({
onInit(store) {
effect(() => logger.log('State:', getState(store)));
@@ -125,19 +133,3 @@ export const AuthStore = signalStore(
},
}),
);
-
-function helpersFactory(store: AuthStore) {
- const waitUntilConnected$ = toObservable(store.status).pipe(
- tap((status) => logger.log('waitUntilConnected$ - status =', status)),
- filter((status) => status === 'connected'),
- shareReplay(1),
- );
-
- const user$ = toObservable(store.user);
-
- return {
- waitUntilConnected$,
- user$,
- };
-}
-export const [injectAuthStoreHelpers] = createInjectionToken(helpersFactory, { deps: [AuthStore] });
diff --git a/app/src/app/shared/auth/util/auth.guard.ts b/app/src/app/shared/auth/util/auth.guard.ts
index f912079..1813e08 100644
--- a/app/src/app/shared/auth/util/auth.guard.ts
+++ b/app/src/app/shared/auth/util/auth.guard.ts
@@ -3,7 +3,7 @@ import { CanMatchFn, Route, Router } from '@angular/router';
import { createLogger } from '@app-shared/logger';
import { RuntimeService } from '@app-shared/runtime.service';
import { map, take } from 'rxjs';
-import { AuthStore, injectAuthStoreHelpers } from '../data/auth.store';
+import { AuthStore } from '../data/auth.store';
const logger = createLogger('authGuard');
@@ -23,10 +23,9 @@ export function authGuard(allowOnly: 'authed' | 'not-authed'): CanMatchFn {
return false;
}
- const { waitUntilConnected$ } = injectAuthStoreHelpers();
const authStore = inject(AuthStore);
- return waitUntilConnected$.pipe(
+ return authStore.waitUntilConnected$.pipe(
map(() => {
const isAuthenticated = authStore.isAuthenticated();
diff --git a/app/src/app/website/feature/about-page.component.ts b/app/src/app/website/feature/about-page.component.ts
index e12afc3..927b83e 100644
--- a/app/src/app/website/feature/about-page.component.ts
+++ b/app/src/app/website/feature/about-page.component.ts
@@ -2,9 +2,8 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
@Component({
selector: 'app-about-page',
- standalone: true,
imports: [],
- template: `
About
`,
+ template: `
About
`,
styles: ``,
changeDetection: ChangeDetectionStrategy.OnPush,
})
diff --git a/app/src/app/website/feature/home-page.component.ts b/app/src/app/website/feature/home-page.component.ts
index 993adf0..b4fbde9 100644
--- a/app/src/app/website/feature/home-page.component.ts
+++ b/app/src/app/website/feature/home-page.component.ts
@@ -2,10 +2,9 @@ import { ChangeDetectionStrategy, Component } from '@angular/core';
@Component({
selector: 'app-home',
- standalone: true,
imports: [],
template: `
-
+
This is the
FullStacksDev Angular
and Firebase simple example app running on Firebase
diff --git a/app/src/app/website/ui/auth-status.component.ts b/app/src/app/website/ui/auth-status.component.ts
index 00a1361..2765c61 100644
--- a/app/src/app/website/ui/auth-status.component.ts
+++ b/app/src/app/website/ui/auth-status.component.ts
@@ -6,7 +6,6 @@ import { LogoutService } from '@app-shared/auth/data/logout.service';
@Component({
selector: 'app-auth-status',
- standalone: true,
imports: [RouterLink, MatButtonModule],
template: `
@if (isAuthenticated()) {
diff --git a/app/src/app/website/website-shell.component.ts b/app/src/app/website/website-shell.component.ts
index 74fff16..1037314 100644
--- a/app/src/app/website/website-shell.component.ts
+++ b/app/src/app/website/website-shell.component.ts
@@ -5,13 +5,12 @@ import { AuthStatusComponent } from './ui/auth-status.component';
@Component({
selector: 'app-shell',
- standalone: true,
imports: [RouterOutlet, RouterLinkWithHref, MatButtonModule, AuthStatusComponent],
template: `