feat: remove postgres & use a single docker container

This commit is contained in:
Elias Schneider
2022-10-11 22:30:06 +02:00
parent e2b3e6a1e8
commit 388ac395ba
18 changed files with 349 additions and 274 deletions

View File

@@ -6,9 +6,9 @@ import {
import { ConfigService } from "@nestjs/config";
import { JwtService } from "@nestjs/jwt";
import { User } from "@prisma/client";
import { PrismaClientKnownRequestError } from "@prisma/client/runtime";
import * as argon from "argon2";
import * as moment from "moment";
import { PrismaService } from "src/prisma/prisma.service";
import { AuthRegisterDTO } from "./dto/authRegister.dto";
import { AuthSignInDTO } from "./dto/authSignIn.dto";
@@ -87,7 +87,9 @@ export class AuthService {
async createRefreshToken(userId: string) {
const refreshToken = (
await this.prisma.refreshToken.create({ data: { userId } })
await this.prisma.refreshToken.create({
data: { userId, expiresAt: moment().add(3, "months").toDate() },
})
).token;
return refreshToken;

View File

@@ -8,7 +8,7 @@ export class PrismaService extends PrismaClient {
super({
datasources: {
db: {
url: config.get("DB_URL"),
url: "file:./pingvin-share.db",
},
},
});