mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
fix: add validation to prevent overwrite user
This commit is contained in:
@@ -129,13 +129,9 @@ export const getUserByToken = async (token: string) => {
|
||||
message: "Invitation not found",
|
||||
});
|
||||
}
|
||||
|
||||
const now = new Date();
|
||||
const isExpired = isAfter(now, new Date(user.expirationDate));
|
||||
|
||||
return {
|
||||
...user,
|
||||
isExpired,
|
||||
isExpired: user.isRegistered,
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ export const createUser = async (input: typeof apiCreateUser._type) => {
|
||||
.update(users)
|
||||
.set({
|
||||
isRegistered: true,
|
||||
expirationDate: new Date().toISOString(),
|
||||
expirationDate: undefined,
|
||||
})
|
||||
.where(eq(users.token, input.token))
|
||||
.returning()
|
||||
|
||||
Reference in New Issue
Block a user