mirror of
https://github.com/nicotsx/ironmount.git
synced 2025-12-10 12:10:51 +01:00
feat(settings): change password
This commit is contained in:
@@ -34,9 +34,6 @@ export const loginDto = describeRoute({
|
||||
},
|
||||
},
|
||||
},
|
||||
401: {
|
||||
description: "Invalid credentials",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -55,9 +52,6 @@ export const registerDto = describeRoute({
|
||||
},
|
||||
},
|
||||
},
|
||||
400: {
|
||||
description: "Invalid request or username already exists",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
@@ -125,5 +119,34 @@ export const getStatusDto = describeRoute({
|
||||
|
||||
export type GetStatusDto = typeof statusResponseSchema.infer;
|
||||
|
||||
export const changePasswordBodySchema = type({
|
||||
currentPassword: "string>0",
|
||||
newPassword: "string>7",
|
||||
});
|
||||
|
||||
const changePasswordResponseSchema = type({
|
||||
success: "boolean",
|
||||
message: "string",
|
||||
});
|
||||
|
||||
export const changePasswordDto = describeRoute({
|
||||
description: "Change current user password",
|
||||
operationId: "changePassword",
|
||||
tags: ["Auth"],
|
||||
responses: {
|
||||
200: {
|
||||
description: "Password changed successfully",
|
||||
content: {
|
||||
"application/json": {
|
||||
schema: resolver(changePasswordResponseSchema),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
export type ChangePasswordDto = typeof changePasswordResponseSchema.infer;
|
||||
|
||||
export type LoginBody = typeof loginBodySchema.infer;
|
||||
export type RegisterBody = typeof registerBodySchema.infer;
|
||||
export type ChangePasswordBody = typeof changePasswordBodySchema.infer;
|
||||
|
||||
Reference in New Issue
Block a user