Parcourir la source

feat(auth): exclude adsUrl from startup ad in login response

Dave il y a 2 mois
Parent
commit
2f9e4d9f16
1 fichiers modifiés avec 7 ajouts et 1 suppressions
  1. 7 1
      apps/box-app-api/src/feature/auth/auth.service.ts

+ 7 - 1
apps/box-app-api/src/feature/auth/auth.service.ts

@@ -79,7 +79,13 @@ export class AuthService {
     } catch (err) {
       this.logger.error('Failed to get startup ad for login', err);
     }
+    let startupAdWithoutUrl: Omit<AdPayload, 'adsUrl'> | null = null;
 
-    return { accessToken, startupAd };
+    if (startupAd) {
+      const { adsUrl, ...rest } = startupAd;
+      startupAdWithoutUrl = rest;
+    }
+
+    return { accessToken, startupAd: startupAdWithoutUrl };
   }
 }