idek man
Some checks failed
Some checks failed
This commit is contained in:
parent
e848b548b5
commit
242b72ca45
7 changed files with 55 additions and 26 deletions
|
@ -5,9 +5,27 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|||
import { routes } from './app.routes';
|
||||
import { provideHttpClient, withInterceptors } from '@angular/common/http';
|
||||
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
|
||||
import { provideOAuthClient } from 'angular-oauth2-oidc';
|
||||
import { OAuthStorage, provideOAuthClient } from 'angular-oauth2-oidc';
|
||||
import { httpInterceptor } from './shared/interceptor/http.interceptor';
|
||||
|
||||
function storageFactory() {
|
||||
return new class implements OAuthStorage {
|
||||
private data: { [key: string]: string } = {};
|
||||
|
||||
getItem(key: string): string | null {
|
||||
return this.data[key];
|
||||
}
|
||||
|
||||
removeItem(key: string): void {
|
||||
delete this.data[key]
|
||||
}
|
||||
|
||||
setItem(key: string, data: string): void {
|
||||
this.data[key] = data;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export const appConfig: ApplicationConfig = {
|
||||
providers: [
|
||||
provideRouter(routes),
|
||||
|
@ -16,5 +34,9 @@ export const appConfig: ApplicationConfig = {
|
|||
provideExperimentalZonelessChangeDetection(),
|
||||
provideAnimationsAsync(),
|
||||
provideOAuthClient(),
|
||||
{
|
||||
provide: OAuthStorage,
|
||||
useFactory: () => storageFactory(),
|
||||
}
|
||||
],
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue