fix and update

This commit is contained in:
lendry
2026-06-29 12:17:25 +03:00
parent 923a028cdd
commit 75ccbe5fc4
39 changed files with 1619 additions and 63 deletions

View File

@@ -0,0 +1,21 @@
import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import { Observable, tap } from 'rxjs';
import type { Response } from 'express';
import { attachFedcmCookieFromAuthResult } from '../lib/fedcm-cookie';
@Injectable()
export class FedcmCookieInterceptor implements NestInterceptor {
constructor(private readonly jwt: JwtService) {}
intercept(context: ExecutionContext, next: CallHandler): Observable<unknown> {
const http = context.switchToHttp();
const response = http.getResponse<Response>();
return next.handle().pipe(
tap((data) => {
attachFedcmCookieFromAuthResult(response, this.jwt, data);
})
);
}
}