chore: hotfixes (#14297)
This commit is contained in:
@@ -14,6 +14,7 @@ export class HttpExceptionFilter implements ExceptionFilter<HttpException> {
|
||||
const statusCode = exception.getStatus();
|
||||
this.logger.error(`Http Exception Filter: ${exception?.message}`, {
|
||||
exception,
|
||||
request,
|
||||
});
|
||||
response.status(statusCode).json({
|
||||
status: ERROR_STATUS,
|
||||
|
||||
@@ -34,6 +34,7 @@ export class PrismaExceptionFilter implements ExceptionFilter {
|
||||
const request = ctx.getRequest();
|
||||
this.logger.error(`PrismaError: ${error.message}`, {
|
||||
error,
|
||||
request,
|
||||
});
|
||||
response.status(HttpStatus.INTERNAL_SERVER_ERROR).json({
|
||||
status: ERROR_STATUS,
|
||||
|
||||
@@ -16,6 +16,7 @@ export class SentryFilter extends BaseExceptionFilter {
|
||||
|
||||
this.logger.error(`Sentry Exception Filter: ${exception?.message}`, {
|
||||
exception,
|
||||
request,
|
||||
});
|
||||
|
||||
// capture if client has been init
|
||||
|
||||
@@ -40,6 +40,7 @@ export class TRPCExceptionFilter implements ExceptionFilter {
|
||||
}
|
||||
this.logger.error(`TRPC Exception Filter: ${exception?.message}`, {
|
||||
exception,
|
||||
request,
|
||||
});
|
||||
response.status(statusCode).json({
|
||||
status: ERROR_STATUS,
|
||||
|
||||
@@ -15,6 +15,7 @@ export class ZodExceptionFilter implements ExceptionFilter {
|
||||
const request = ctx.getRequest();
|
||||
this.logger.error(`ZodError: ${error.message}`, {
|
||||
error,
|
||||
request,
|
||||
});
|
||||
response.status(HttpStatus.BAD_REQUEST).json({
|
||||
status: ERROR_STATUS,
|
||||
|
||||
@@ -48,7 +48,7 @@ export class TokensRepository {
|
||||
}
|
||||
|
||||
async createOAuthTokens(clientId: string, ownerId: number) {
|
||||
const accessExpiry = DateTime.now().plus({ minute: 1 }).startOf("minute").toJSDate();
|
||||
const accessExpiry = DateTime.now().plus({ minute: 60 }).startOf("minute").toJSDate();
|
||||
const refreshExpiry = DateTime.now().plus({ year: 1 }).startOf("day").toJSDate();
|
||||
const [accessToken, refreshToken] = await this.dbWrite.prisma.$transaction([
|
||||
this.dbWrite.prisma.accessToken.create({
|
||||
|
||||
@@ -21,7 +21,7 @@ export class UsersRepository {
|
||||
) {
|
||||
this.formatInput(user);
|
||||
|
||||
return this.dbRead.prisma.user.create({
|
||||
return this.dbWrite.prisma.user.create({
|
||||
data: {
|
||||
...user,
|
||||
username,
|
||||
@@ -34,7 +34,7 @@ export class UsersRepository {
|
||||
}
|
||||
|
||||
async addToOAuthClient(userId: number, oAuthClientId: string) {
|
||||
return this.dbRead.prisma.user.update({
|
||||
return this.dbWrite.prisma.user.update({
|
||||
data: {
|
||||
platformOAuthClients: {
|
||||
connect: { id: oAuthClientId },
|
||||
|
||||
Reference in New Issue
Block a user