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,5 +1,7 @@
import { Controller, Get } from '@nestjs/common';
import { Controller, Get, Session, UseGuards } from '@nestjs/common';
import { AppService } from './app.service';
import { AuthGuard } from './auth.guard';
import { SessionContainer } from "supertokens-node/recipe/session";
@Controller()
export class AppController {
@@ -9,4 +11,11 @@ export class AppController {
getHello(): string {
return this.appService.getHello();
}
@Get('test')
@UseGuards(AuthGuard)
async getTest(@Session() session: SessionContainer): Promise<string> {
// TODO: magic
return "magic";
}
}