feat: add change password endpoint using old password;
feat: implement change password service method with validation; fix: correct ErrorIsOneOf function logic to return true on match; refactor: rename 'log_out_accounts' to 'log_out_sessions' for clarity; refactor: update session termination to return GUIDs and cache in Redis; fix: ensure RollbackOnError only rolls back uncommitted transactions; fix: handle transaction commit errors properly in dbHelper; refactor: add helper methods for session termination and registration; refactor: pass client info to login and registration complete methods; fix: improve token validation error handling in refresh endpoint; refactor: update auth middleware to set session info correctly; chore: remove unused ClientInfo DTO; fix: correct password reset complete to use session termination helper; refactor: adjust database queries for session management; chore: update SQL schema and queries for sessions; docs: update swagger docs with new endpoint and model changes
This commit is contained in:
@@ -38,6 +38,44 @@ const docTemplate = `{
|
||||
"responses": {}
|
||||
}
|
||||
},
|
||||
"/auth/changePassword": {
|
||||
"post": {
|
||||
"security": [
|
||||
{
|
||||
"JWT": []
|
||||
}
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"Auth"
|
||||
],
|
||||
"summary": "Set new password using the old password",
|
||||
"parameters": [
|
||||
{
|
||||
"description": " ",
|
||||
"name": "request",
|
||||
"in": "body",
|
||||
"required": true,
|
||||
"schema": {
|
||||
"$ref": "#/definitions/models.ChangePasswordRequest"
|
||||
}
|
||||
}
|
||||
],
|
||||
"responses": {
|
||||
"200": {
|
||||
"description": "Password successfully changed"
|
||||
},
|
||||
"403": {
|
||||
"description": "Invalid old password"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"/auth/login": {
|
||||
"post": {
|
||||
"consumes": [
|
||||
@@ -391,6 +429,24 @@ const docTemplate = `{
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.ChangePasswordRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
"old_password",
|
||||
"password"
|
||||
],
|
||||
"properties": {
|
||||
"old_password": {
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"type": "string"
|
||||
},
|
||||
"totp": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"models.LoginRequest": {
|
||||
"type": "object",
|
||||
"required": [
|
||||
@@ -445,7 +501,7 @@ const docTemplate = `{
|
||||
"email": {
|
||||
"type": "string"
|
||||
},
|
||||
"log_out_accounts": {
|
||||
"log_out_sessions": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"password": {
|
||||
|
||||
Reference in New Issue
Block a user