csrf.service.ts 298B

123456789101112
  1. import { Injectable } from '@angular/core';
  2. import { CookieService } from 'ngx-cookie';
  3. @Injectable({ providedIn: 'root' })
  4. export class CSRFService {
  5. constructor(private cookieService: CookieService) {}
  6. getCSRF(name = 'XSRF-TOKEN') {
  7. return this.cookieService.get(name);
  8. }
  9. }