fuse-angular/src/app/core/auth/auth.provider.ts
2024-12-29 12:23:56 +03:00

17 lines
549 B
TypeScript

import { provideHttpClient, withInterceptors } from '@angular/common/http';
import {
EnvironmentProviders,
Provider,
inject,
provideEnvironmentInitializer,
} from '@angular/core';
import { authInterceptor } from 'app/core/auth/auth.interceptor';
import { AuthService } from 'app/core/auth/auth.service';
export const provideAuth = (): Array<Provider | EnvironmentProviders> => {
return [
provideHttpClient(withInterceptors([authInterceptor])),
provideEnvironmentInitializer(() => inject(AuthService)),
];
};