OVIRO LogoOVIRO
HRMNhân viên

Khôi phục tài khoản

Quy trình khôi phục mật khẩu bao gồm khởi tạo xác thực và cập nhật mật khẩu mới.

1. Khởi tạo khôi phục mật khẩu

Gửi mã xác thực OTP đến email người dùng để bắt đầu quy trình khôi phục mật khẩu.

Endpoint

POST /v1/users/recoveryinit

Body Parameters

TênKiểuBắt buộcMô tả
emailstringEmail người dùng

Response Schema

{
  "id": "550e8400-e29b-41d4-a716-446655440000",
  "passport_id": "8c6600c3-...",
  "full_name": "Nguyễn Văn A",
  "email": "[email protected]",
  "otp_length": 6,
  "date_created": 1640995200,
  "date_expired": 1640995500,
  "metadata": {
    "action": "recovery"
  }
}

2. Hoàn tất khôi phục mật khẩu

Xác thực OTP và thiết lập mật khẩu mới cho tài khoản.

Endpoint

POST /v1/users/recoveryfinish

Body Parameters

TênKiểuBắt buộcMô tả
emailstringEmail người dùng
passwordstringMật khẩu mới (tối thiểu 7 ký tự)
otpstringMã OTP nhận được qua email
passport_idstringID passport nhận được từ bước Init

Response Schema

Trả về object User của người dùng đã được cập nhật mật khẩu.


Error Codes

HTTPCodeMô tả
422error_email_requiredThiếu email
422error_email_invalidĐịnh dạng email không hợp lệ
422error_email_not_existedEmail không tồn tại trong hệ thống
422error_password_length_invalidMật khẩu quá ngắn
422error_passport_id_requiredThiếu ID passport
422error_otp_requiredThiếu mã OTP
422error_passport_otp_not_foundOTP đã hết hạn hoặc không tồn tại
422error_otp_invalidMã OTP không chính xác
500error_save_passportLỗi lưu trữ thông tin xác thực
500error_update_passwordLỗi khi cập nhật mật khẩu mới

On this page