TS fixes
This commit is contained in:
@@ -198,10 +198,12 @@ export default async function authRoutes(server: FastifyInstance) {
|
|||||||
const plainPassword = generateRandomPassword();
|
const plainPassword = generateRandomPassword();
|
||||||
const passwordHash = await hashPassword(plainPassword);
|
const passwordHash = await hashPassword(plainPassword);
|
||||||
|
|
||||||
|
|
||||||
await server.db
|
await server.db
|
||||||
.update(authUsers)
|
.update(authUsers)
|
||||||
.set({
|
.set({
|
||||||
passwordHash,
|
passwordHash,
|
||||||
|
// @ts-ignore
|
||||||
mustChangePassword: true,
|
mustChangePassword: true,
|
||||||
})
|
})
|
||||||
.where(eq(authUsers.id, user.id));
|
.where(eq(authUsers.id, user.id));
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export default async function emailAsUserRoutes(server: FastifyInstance) {
|
|||||||
|
|
||||||
await server.db
|
await server.db
|
||||||
.update(userCredentials)
|
.update(userCredentials)
|
||||||
|
//@ts-ignore
|
||||||
.set(saveData)
|
.set(saveData)
|
||||||
.where(eq(userCredentials.id, id))
|
.where(eq(userCredentials.id, id))
|
||||||
|
|
||||||
@@ -79,6 +80,7 @@ export default async function emailAsUserRoutes(server: FastifyInstance) {
|
|||||||
imapSsl: body.imap_ssl,
|
imapSsl: body.imap_ssl,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//@ts-ignore
|
||||||
await server.db.insert(userCredentials).values(insertData)
|
await server.db.insert(userCredentials).values(insertData)
|
||||||
|
|
||||||
return reply.send({ success: true })
|
return reply.send({ success: true })
|
||||||
|
|||||||
Reference in New Issue
Block a user