Principal store
The signed-in user's data, loaded once and shared through a signal store — initials, admin status, and user-override state.
PrincipalStore holds the authenticated user's data — name, email, administrator status, password expiry —
loaded once via initialize() and shared by every consumer through NgRx Signals.
Minimal example
import { Component, inject } from "@angular/core";
import { PrincipalStore } from "@sinequa/atomic-angular";
@Component({
selector: "user-badge",
template: `<span>{{ principal.fullName() }} ({{ principal.initials() }})</span>`,
})
export class UserBadgeComponent {
protected readonly principal = inject(PrincipalStore);
}How it works
initialize() fetches the principal through the shared client (so it goes through the same auth handling as
the rest of @sinequa/atomic — cookies included, and the SSO-aware auto-authentication flag) and patches the
store. Concurrent calls — a guard awaiting the fetch while another initialization is already in flight — share
the same promise rather than issuing two requests.
Options
Prop
Type
Pitfalls
What's next
AuthGuard
A functional route guard that checks authentication, loads the principal, and redirects to change-password when a credentials session's password has expired.
Auth interceptor
Attaches the CSRF token, bearer authorization and impersonation headers to every request built with Angular's HttpClient — the one channel the atomic client itself never sees.