fix and update

This commit is contained in:
lendry
2026-07-01 14:03:57 +03:00
parent 6929fb41fc
commit 55deb5c152
2 changed files with 16 additions and 6 deletions

View File

@@ -1,6 +1,6 @@
import { CallHandler, ExecutionContext, Injectable, NestInterceptor } from '@nestjs/common';
import { JwtService } from '@nestjs/jwt';
import { Observable, tap } from 'rxjs';
import { Observable, mergeMap } from 'rxjs';
import type { Response } from 'express';
import { attachFedcmCookieFromAuthResult } from '../lib/fedcm-cookie';
@@ -13,8 +13,9 @@ export class FedcmCookieInterceptor implements NestInterceptor {
const response = http.getResponse<Response>();
return next.handle().pipe(
tap((data) => {
attachFedcmCookieFromAuthResult(response, this.jwt, data);
mergeMap(async (data) => {
await attachFedcmCookieFromAuthResult(response, this.jwt, data);
return data;
})
);
}