Implemented SuperTokens
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user