diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index cb14fd89f..06a06d21c 100644 --- a/apps/api/src/lib/common.ts +++ b/apps/api/src/lib/common.ts @@ -16,7 +16,7 @@ import { day } from './dayjs'; import * as serviceFields from './serviceFields' import axios from 'axios'; -export const version = '3.1.1'; +export const version = '3.1.2'; export const isDev = process.env.NODE_ENV === 'development'; const algorithm = 'aes-256-ctr'; diff --git a/apps/api/src/routes/api/v1/applications/handlers.ts b/apps/api/src/routes/api/v1/applications/handlers.ts index 858bedd5b..b5e235335 100644 --- a/apps/api/src/routes/api/v1/applications/handlers.ts +++ b/apps/api/src/routes/api/v1/applications/handlers.ts @@ -267,7 +267,8 @@ export async function saveApplicationSettings(request: FastifyRequest, reply: FastifyReply) if (userFound.password === 'RESETME') { const hashedPassword = await hashPassword(password); if (userFound.updatedAt < new Date(Date.now() - 1000 * 60 * 10)) { - await prisma.user.update({ - where: { email: userFound.email }, - data: { password: 'RESETTIMEOUT' } - }); + if (userFound.id === '0') { + await prisma.user.update({ + where: { email: userFound.email }, + data: { password: 'RESETME' } + }); + } else { + await prisma.user.update({ + where: { email: userFound.email }, + data: { password: 'RESETTIMEOUT' } + }); + } + throw { status: 500, message: 'Password reset link has expired. Please request a new one.' diff --git a/package.json b/package.json index 892dd2f30..e6b7f6407 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "coolify", "description": "An open-source & self-hostable Heroku / Netlify alternative.", - "version": "3.1.1", + "version": "3.1.2", "license": "AGPL-3.0", "scripts": { "db:studio": "pnpm run --filter coolify-api db:studio",