Browse Source
Merge pull request #21595 from abpframework/ng/core-xsrf-configuration
Utilize xsrf-token configuration to AbpCore provider
pull/21596/head
sumeyye
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
12 additions and
0 deletions
-
npm/ng-packs/packages/core/src/lib/providers/core-module-config.provider.ts
|
|
|
@ -1,5 +1,10 @@ |
|
|
|
import { makeEnvironmentProviders, APP_INITIALIZER, Injector, Provider } from '@angular/core'; |
|
|
|
import { TitleStrategy } from '@angular/router'; |
|
|
|
import { |
|
|
|
provideHttpClient, |
|
|
|
withInterceptorsFromDi, |
|
|
|
withXsrfConfiguration, |
|
|
|
} from '@angular/common/http'; |
|
|
|
import { |
|
|
|
CORE_OPTIONS, |
|
|
|
LOCALIZATIONS, |
|
|
|
@ -92,6 +97,13 @@ export function withCompareFuncFactory( |
|
|
|
|
|
|
|
export function provideAbpCore(...features: CoreFeature<CoreFeatureKind>[]) { |
|
|
|
const providers = [ |
|
|
|
provideHttpClient( |
|
|
|
withInterceptorsFromDi(), |
|
|
|
withXsrfConfiguration({ |
|
|
|
cookieName: 'XSRF-TOKEN', |
|
|
|
headerName: 'RequestVerificationToken', |
|
|
|
}), |
|
|
|
), |
|
|
|
LocaleProvider, |
|
|
|
CookieLanguageProvider, |
|
|
|
{ |
|
|
|
|