mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
fixes cookie_prefix for development setups
This commit is contained in:
parent
48796e6961
commit
35dcc54dc8
@ -17,8 +17,10 @@ export class CsrfInterceptor implements HttpInterceptor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
intercept(request: HttpRequest<unknown>, next: HttpHandler): Observable<HttpEvent<unknown>> {
|
||||||
|
let prefix = ""
|
||||||
let prefix = this.meta.getTag('name=cookie_prefix').content
|
if (this.meta.getTag('name=cookie_prefix')) {
|
||||||
|
prefix = this.meta.getTag('name=cookie_prefix').content
|
||||||
|
}
|
||||||
let csrfToken = this.cookieService.get(`${prefix?prefix:''}csrftoken`)
|
let csrfToken = this.cookieService.get(`${prefix?prefix:''}csrftoken`)
|
||||||
if (csrfToken) {
|
if (csrfToken) {
|
||||||
request = request.clone({
|
request = request.clone({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user