From 35dcc54dc875f5015ac003f7701f4f4c04aa8350 Mon Sep 17 00:00:00 2001 From: jonaswinkler Date: Thu, 17 Dec 2020 21:54:05 +0100 Subject: [PATCH] fixes cookie_prefix for development setups --- src-ui/src/app/interceptors/csrf.interceptor.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src-ui/src/app/interceptors/csrf.interceptor.ts b/src-ui/src/app/interceptors/csrf.interceptor.ts index 2ef03dc56..2c654aa36 100644 --- a/src-ui/src/app/interceptors/csrf.interceptor.ts +++ b/src-ui/src/app/interceptors/csrf.interceptor.ts @@ -17,8 +17,10 @@ export class CsrfInterceptor implements HttpInterceptor { } intercept(request: HttpRequest, next: HttpHandler): Observable> { - - let prefix = this.meta.getTag('name=cookie_prefix').content + let prefix = "" + if (this.meta.getTag('name=cookie_prefix')) { + prefix = this.meta.getTag('name=cookie_prefix').content + } let csrfToken = this.cookieService.get(`${prefix?prefix:''}csrftoken`) if (csrfToken) { request = request.clone({