MCPcopy
hub / github.com/louislam/dockge / doubleCheckPassword

Function doubleCheckPassword

backend/util-server.ts:86–100  ·  view source on GitHub ↗
(socket : DockgeSocket, currentPassword : unknown)

Source from the content-addressed store, hash-verified

84}
85
86export async function doubleCheckPassword(socket : DockgeSocket, currentPassword : unknown) {
87 if (typeof currentPassword !== "string") {
88 throw new Error("Wrong data type?");
89 }
90
91 let user = await R.findOne("user", " id = ? AND active = 1 ", [
92 socket.userID,
93 ]);
94
95 if (!user || !verifyPassword(currentPassword, user.password)) {
96 throw new Error("Incorrect current password");
97 }
98
99 return user;
100}
101
102export function fileExists(file : string) {
103 return fs.promises.access(file, fs.constants.F_OK)

Callers 1

createMethod · 0.90

Calls 1

verifyPasswordFunction · 0.90

Tested by

no test coverage detected