mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-15 18:15:53 +00:00
feat: fixed eslint and resolved all eslint issues
This commit is contained in:
@@ -12,7 +12,7 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
|
||||
method: "POST",
|
||||
url: "/srp1",
|
||||
config: {
|
||||
rateLimit:passwordRateLimit
|
||||
rateLimit: passwordRateLimit
|
||||
},
|
||||
schema: {
|
||||
body: z.object({
|
||||
@@ -39,7 +39,7 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
|
||||
method: "POST",
|
||||
url: "/change-password",
|
||||
config: {
|
||||
rateLimit:passwordRateLimit
|
||||
rateLimit: passwordRateLimit
|
||||
},
|
||||
schema: {
|
||||
body: z.object({
|
||||
@@ -64,7 +64,7 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
|
||||
const appCfg = getConfig();
|
||||
await server.services.password.changePassword({ ...req.body, userId: req.permission.id });
|
||||
|
||||
res.cookie("jid", appCfg.COOKIE_SECRET_SIGN_KEY, {
|
||||
void res.cookie("jid", appCfg.COOKIE_SECRET_SIGN_KEY, {
|
||||
httpOnly: true,
|
||||
path: "/",
|
||||
sameSite: "strict",
|
||||
@@ -78,7 +78,7 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
|
||||
method: "POST",
|
||||
url: "/email/password-reset",
|
||||
config: {
|
||||
rateLimit:passwordRateLimit
|
||||
rateLimit: passwordRateLimit
|
||||
},
|
||||
schema: {
|
||||
body: z.object({
|
||||
@@ -103,7 +103,7 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
|
||||
method: "POST",
|
||||
url: "/email/password-reset-verify",
|
||||
config: {
|
||||
rateLimit:passwordRateLimit
|
||||
rateLimit: passwordRateLimit
|
||||
},
|
||||
schema: {
|
||||
body: z.object({
|
||||
@@ -136,7 +136,7 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
|
||||
method: "POST",
|
||||
url: "/backup-private-key",
|
||||
config: {
|
||||
rateLimit:passwordRateLimit
|
||||
rateLimit: passwordRateLimit
|
||||
},
|
||||
onRequest: verifyAuth([AuthMode.JWT]),
|
||||
schema: {
|
||||
@@ -156,10 +156,10 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
|
||||
}
|
||||
},
|
||||
handler: async (req) => {
|
||||
const token = validateSignUpAuthorization(req.headers.authorization as string, "",false)!
|
||||
const token = validateSignUpAuthorization(req.headers.authorization as string, "", false)!;
|
||||
const backupPrivateKey = await server.services.password.createBackupPrivateKey({
|
||||
...req.body,
|
||||
userId: token.userId,
|
||||
userId: token.userId
|
||||
});
|
||||
if (!backupPrivateKey) throw new Error("Failed to create backup key");
|
||||
|
||||
@@ -171,7 +171,7 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
|
||||
method: "GET",
|
||||
url: "/backup-private-key",
|
||||
config: {
|
||||
rateLimit:passwordRateLimit
|
||||
rateLimit: passwordRateLimit
|
||||
},
|
||||
schema: {
|
||||
response: {
|
||||
@@ -182,7 +182,7 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
|
||||
}
|
||||
},
|
||||
handler: async (req) => {
|
||||
const token = validateSignUpAuthorization(req.headers.authorization as string, "",false)!
|
||||
const token = validateSignUpAuthorization(req.headers.authorization as string, "", false)!;
|
||||
const backupPrivateKey = await server.services.password.getBackupPrivateKeyOfUser(
|
||||
token.userId
|
||||
);
|
||||
@@ -213,10 +213,10 @@ export const registerPasswordRouter = async (server: FastifyZodProvider) => {
|
||||
}
|
||||
},
|
||||
handler: async (req) => {
|
||||
const token = validateSignUpAuthorization(req.headers.authorization as string, "",false)!
|
||||
const token = validateSignUpAuthorization(req.headers.authorization as string, "", false)!;
|
||||
await server.services.password.resetPasswordByBackupKey({
|
||||
...req.body,
|
||||
userId: token.userId,
|
||||
userId: token.userId
|
||||
});
|
||||
|
||||
return { message: "Successfully updated backup private key" };
|
||||
|
||||
Reference in New Issue
Block a user