Hello, i'm having an issue with the integration to NestJs. I'm getting a blank (white) screen when i...
t
Hello, i'm having an issue with the integration to NestJs. I'm getting a blank (white) screen when i try to load the dashboard... Everything seems to work fine when i call the signup api from postman though... Any ideas please?...
r
@akiraa1424 here
t
hey, thanks for the link... but where do i add this please?...
the dashboard init?...
r
however you are adding to the the CSP header in the first place. That middleware / lib should have a way
t
i'm not sending the header at all...i'm working with the default setup...
Copy code
app.enableCors({
    origin: [WEBSITE_DOMAIN, 'http://localhost:7000', 'http://localhost:4321'],
    allowedHeaders: ['content-type', ...supertokens.getAllCORSHeaders()],
    credentials: true,
  });
hey, got it fixed by doing this...
Copy code
app.use(
    helmet({
      contentSecurityPolicy: {
        directives: {
          scriptSrc: [
            "'self'",
            "'unsafe-inline'",
            "'unsafe-eval'",
            'https://cdn.jsdelivr.net/gh/supertokens/',
          ],
          imgSrc: [
            "'self'",
            'data:',
            'https://cdn.jsdelivr.net/gh/supertokens/',
          ],
        },
      },
    }),
  );
still not sure why this was needed in my project, since the sample app works without this ...
r
cause the sample app doesn't have contentSecurityPolicy
t
i see...meaning as long as i'm importing helmet in my project, this has to be configured...got it... thanks a lot...😄
7 Views