Post release / release (push) Canceled after 0s
* refactor: no_available_users_found_error for team event * fix: hosts_unavailable_for_booking * fix: Cannot read properties of undefined (reading 'replace') * fix: Cannot read properties of undefined (reading 'phoneNumber') * fix: No SelectedCalendar found. * fix: Cannot read properties of undefined (reading 'length') * refactor: add bookings errors service
21 lines
661 B
TypeScript
21 lines
661 B
TypeScript
import { ExecutionContext, Inject } from "@nestjs/common";
|
|
import { Reflector } from "@nestjs/core";
|
|
import { AuthGuard } from "@nestjs/passport";
|
|
|
|
import { ApiAuthGuardOnlyAllow } from "../../decorators/api-auth-guard-only-allow.decorator";
|
|
|
|
export class ApiAuthGuard extends AuthGuard("api-auth") {
|
|
constructor(@Inject(Reflector) private readonly reflector: Reflector) {
|
|
super();
|
|
}
|
|
|
|
getRequest(context: ExecutionContext) {
|
|
const request = context.switchToHttp().getRequest();
|
|
|
|
const allowedMethods = this.reflector.get(ApiAuthGuardOnlyAllow, context.getHandler());
|
|
request.allowedAuthMethods = allowedMethods;
|
|
|
|
return request;
|
|
}
|
|
}
|