diff --git a/api/src/unraid-api/auth/cookie.guard.spec.ts b/api/src/unraid-api/auth/cookie.guard.spec.ts deleted file mode 100644 index ac9ee230d..000000000 --- a/api/src/unraid-api/auth/cookie.guard.spec.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { CookieGuard } from './cookie.guard'; - -describe('CookieGuard', () => { - it('should be defined', () => { - expect(new CookieGuard()).toBeDefined(); - }); -}); diff --git a/api/src/unraid-api/auth/cookie.guard.ts b/api/src/unraid-api/auth/cookie.guard.ts deleted file mode 100644 index 9c33591b9..000000000 --- a/api/src/unraid-api/auth/cookie.guard.ts +++ /dev/null @@ -1,20 +0,0 @@ -import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common'; -import { Observable } from 'rxjs'; -import { CookieService } from './cookie.service'; - -@Injectable() -export class CookieGuard implements CanActivate { - constructor(private service: CookieService) {} - - /** - * Checks if the request contains a valid unraid session cookie. - * - * If it does, it means the user is logged into their unraid server. - * They should be allowed to access it from an any domain, regardless of CORS - * (although that logic doesn't happen here). - */ - canActivate(context: ExecutionContext): boolean | Promise | Observable { - const request = context.switchToHttp().getRequest(); - return this.service.hasValidAuthCookie(request.cookies); - } -}