mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-21 01:16:49 +00:00
feat(infisical-pg): fixed some bugs on org invite missing auth method
This commit is contained in:
@@ -245,7 +245,8 @@ export const registerRoutes = async (
|
||||
const superAdminService = superAdminServiceFactory({
|
||||
userDal,
|
||||
authService: loginService,
|
||||
serverCfgDal: superAdminDal
|
||||
serverCfgDal: superAdminDal,
|
||||
orgService
|
||||
});
|
||||
const apiKeyService = apiKeyServiceFactory({ apiKeyDal, userDal });
|
||||
|
||||
|
||||
@@ -118,4 +118,35 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
|
||||
return { message: "Successfully updated backup private key", backupPrivateKey };
|
||||
}
|
||||
});
|
||||
|
||||
server.route({
|
||||
method: "POST",
|
||||
url: "/password-reset",
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
schema: {
|
||||
body: z.object({
|
||||
protectedKey: z.string().trim(),
|
||||
protectedKeyIV: z.string().trim(),
|
||||
protectedKeyTag: z.string().trim(),
|
||||
encryptedPrivateKey: z.string().trim(),
|
||||
encryptedPrivateKeyIV: z.string().trim(),
|
||||
encryptedPrivateKeyTag: z.string().trim(),
|
||||
salt: z.string().trim(),
|
||||
verifier: z.string().trim()
|
||||
}),
|
||||
response: {
|
||||
200: z.object({
|
||||
message: z.string()
|
||||
})
|
||||
}
|
||||
},
|
||||
handler: async (req) => {
|
||||
await server.services.password.resetPasswordByBackupKey({
|
||||
...req.body,
|
||||
userId: req.permission.id
|
||||
});
|
||||
|
||||
return { message: "Successfully updated backup private key" };
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user