Implemented SuperTokens

This commit is contained in:
2022-09-07 10:09:17 +02:00
parent 6bb920861a
commit c44be1bcc1
13 changed files with 254 additions and 544 deletions

View File

@@ -1,8 +1,17 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import supertokens from 'supertokens-node';
import { SupertokensExceptionFilter } from './auth/auth.filter';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
await app.listen(3000);
app.enableCors({
origin: [process.env.WEBAPP_URL],
allowedHeaders: ['content-type', ...supertokens.getAllCORSHeaders()],
credentials: true,
});
app.useGlobalFilters(new SupertokensExceptionFilter());
await app.listen(process.env.APP_PORT);
}
bootstrap();