Browse Source

Merge pull request #7251 from abpframework/docs/xsrf-token

docs: add small note about xsrf token setup
pull/7252/head
Mehmet Erim 6 years ago
committed by GitHub
parent
commit
9010a37757
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 17
      docs/en/CSRF-Anti-Forgery.md

17
docs/en/CSRF-Anti-Forgery.md

@ -144,4 +144,19 @@ Let's talk about why.
First, take a look at [Angular's code](https://github.com/angular/angular/blob/master/packages/common/http/src/xsrf.ts#L81)
It does not intercept any request that starts with `http://` or `https://`. There is a good reason for that. Any cross-site request does not need this token for security. This verification is only valid if the request is made to the same domain from which the web page is served. So, simply put, if you serve everything from a single domain, you just use a relative path.
It does not intercept any request that starts with `http://` or `https://`. There is a good reason for that. Any cross-site request does not need this token for security. This verification is only valid if the request is made to the same domain from which the web page is served. So, simply put, if you serve everything from a single domain, you just use a relative path.
If you serve your APIs from the root, i.e. no context root (https://testdomain.com/api/identity/users), leave `url` empty as follows:
```typescript
export const environment = {
production: true,
// ....
apis: {
default: {
url: '', // <- should be empty string, not '/'
// ...
},
},
} as Config.Environment;
```

Loading…
Cancel
Save