Skip to main content
Forgot your password? MediGuide provides a secure, multi-step password recovery process to help you regain access to your account.

Overview

The password recovery process involves three main steps:
  1. Email Verification: Confirm your account email address
  2. Reset Code Validation: Enter the unique code sent to your email
  3. Password Reset: Create and confirm your new password
The entire process is designed with security in mind, using time-limited reset codes and validation at each step.

Starting Password Recovery

1

Navigate to Login Page

Open MediGuide and ensure you’re on the Iniciar Sesión (Login) tab.You’ll see the standard login form with username and password fields.
2

Click 'Forgot Password' Link

Below the login button, you’ll find:“¿Olvidaste tu contraseña?” (Forgot your password?)Click this link to begin the password recovery process.This will take you to the Recuperar Contraseña (Recover Password) page.

Password Recovery Process

Step 1: Email Verification

1

Enter Your Email Address

In the Correo Electrónico (Email) field, enter the email address you used when creating your account.Email Validation:
  • Must be a valid email format ([email protected])
  • System checks: ^[^\s@]+@[^\s@]+\.[^\s@]+$
Error Message if Invalid: “Por favor ingresa un correo electrónico válido”
2

Submit Email

Click the “Enviar Código” (Send Code) button.During Processing:
  • Button text changes to “Enviando…” (Sending)
  • Button is disabled to prevent duplicate requests
What Happens:
  • System searches for an account with that email
  • If found, generates a 6-digit reset code
  • Code is valid for 30 minutes
  • Code is stored in database with expiration timestamp
3

Check for Confirmation

If Successful:
  • Message: “Se ha enviado un código de recuperación a tu correo electrónico”
  • A blue box displays your reset code (for testing/development)
  • You automatically proceed to Step 2
If Email Not Found:
  • Error: “No se encontró cuenta con este correo”
  • Verify the email address and try again
  • Consider that you may have used a different email

Step 2: Reset Code Validation

After email verification, you’ll see the code entry form.
1

Locate Your Reset Code

In Development/Testing: The code is displayed on screen in a highlighted blue box for easy copying.In Production: Check your email inbox (and spam folder) for the reset code.Code Format:
  • 6-digit numeric code
  • Example: 123456, 987654
  • Valid for 30 minutes from generation
2

Enter Reset Code

In the Código de Recuperación (Recovery Code) field:
  • Type or paste the 6-digit code
  • Code must be exactly 6 characters
Validation: If code is less than 6 characters, you’ll see: “El código debe tener al menos 6 caracteres”
3

Verify Code

Click “Verificar Código” (Verify Code) button.During Processing:
  • Button shows “Verificando…” (Verifying)
  • System checks code against database
  • Verifies code hasn’t expired (30-minute window)
Possible Outcomes:Success:
  • Message: “Código verificado. Ingresa tu nueva contraseña.”
  • Proceed to Step 3 (password creation)
Invalid Code:
  • Error: “Código de recuperación inválido”
  • Code doesn’t match database record
  • Check for typos and try again
Expired Code:
  • Error: “El código de recuperación ha expirado”
  • 30 minutes have passed since code generation
  • Start over from Step 1 to get a new code

Step 3: Create New Password

Once your code is verified, you’ll see the password creation form.
1

Enter New Password

In the Nueva Contraseña (New Password) field:
  • Type your desired new password
  • Use the Mostrar/Ocultar (Show/Hide) button to toggle visibility
Password Requirements:
  • Minimum 6 characters
  • Must contain at least one special character: !@#$%^&*()_+-=[]{};\':"|,.<>/?
Validation Errors:
  • Too short: “La contraseña debe tener al menos 6 caracteres”
  • No special char: “La contraseña debe contener al menos un carácter especial (!@#$%^&* etc.)”
2

Confirm New Password

In the Confirmar Contraseña (Confirm Password) field:
  • Re-type your new password exactly
  • Use the Mostrar/Ocultar button if needed
Validation: Both passwords must match exactly. If they don’t: “Las contraseñas no coinciden”
3

Submit New Password

Click “Actualizar Contraseña” (Update Password) button.During Processing:
  • Button shows “Actualizando…” (Updating)
  • System performs final validation
  • Checks reset code is still valid
  • Updates password in database
  • Clears reset code and expiration
Success:
  • Message: “¡Contraseña actualizada exitosamente! Redirigiendo…”
  • After 2 seconds, automatically returns to login page
  • You can now log in with your new password

Security Features

Time-Limited Reset Codes

  • Validity Period: 30 minutes (1800 seconds)
  • Expiration Check: Validated on each request
  • Calculation: Date.now() + 30 * 60 * 1000
  • Single Use: Code is cleared after successful password reset

Code Generation

  • Format: Random 6-digit numeric string
  • Generation: Math.random().toString().substring(2, 8)
  • Storage: Stored as reset_code in user database record
  • Expiration: Stored as reset_code_expiry timestamp

Validation Steps

  1. Email exists in database
  2. Reset code matches stored value
  3. Code hasn’t expired (compared to current time)
  4. New password meets strength requirements
  5. Passwords match (new and confirm)
  6. Code and expiration cleared after successful reset

API Endpoints Used

The password recovery process uses three backend endpoints:

1. Request Reset Code

Endpoint: /api/users/forgot-password
  • Method: POST
  • Body: { email: "[email protected]" }
  • Response: { message: "Reset code sent", resetCode: "123456" }

2. Verify Reset Code

Endpoint: /api/users/verify-reset-code
  • Method: POST
  • Body: { email: "[email protected]", resetCode: "123456" }
  • Response: { message: "Reset code verified", userId: 123 }

3. Reset Password

Endpoint: /api/users/reset-password
  • Method: POST
  • Body: { email: "[email protected]", resetCode: "123456", newPassword: "newPass123!" }
  • Response: { message: "Contraseña actualizada exitosamente", userId: 123, username: "user" }
At any point during the recovery process:
  • “Volver a Iniciar Sesión” button is available
  • Returns you to the main login page
  • Aborts the current recovery attempt
  • Can start over if needed
Browser Back Button:
  • Intercepted by the application
  • Prevents accidental navigation away
  • Use the provided “Volver” button instead

Error Messages Reference

Email Step Errors

Error MessageCauseSolution
”Por favor ingresa un correo electrónico válido”Invalid email formatCheck for typos, ensure @ and domain
”No se encontró cuenta con este correo”Email not in databaseVerify email, check if account was created with different email
”Error: Servidor no respondió”Server connection issueCheck internet connection, try again

Code Verification Errors

Error MessageCauseSolution
”El código debe tener al menos 6 caracteres”Code too shortEnter all 6 digits
”Código de recuperación inválido”Wrong code enteredDouble-check code, re-type carefully
”El código de recuperación ha expirado”More than 30 min passedRequest new code from Step 1

Password Creation Errors

Error MessageCauseSolution
”Las contraseñas no coinciden”New and confirm don’t matchRe-type password carefully
”La contraseña debe tener al menos 6 caracteres”Password too shortUse at least 6 characters
”La contraseña debe contener al menos un carácter especial”No special characterAdd !, @, #, $, %, etc.

Troubleshooting

In Development: The code is displayed on screen.In Production:
  • Check spam/junk folder
  • Verify email address is correct
  • Wait a few minutes for email delivery
  • If still missing, try requesting a new code
Reset codes are valid for 30 minutes. If expired:
  • Click “Volver a Iniciar Sesión”
  • Start password recovery again
  • Complete the process within 30 minutes
Unfortunately, without your email address, you cannot recover your account through this system. Consider:
  • Checking old emails or documents
  • Looking for MediGuide confirmation emails
  • Creating a new account if necessary
The requirements ensure account security:
  • 6+ characters (easy to remember phrase)
  • 1 special character (add ! or @ at the end)
  • Example: mypass!23 or health@2024
Connection issues can occur. Try:
  • Checking internet connectivity
  • Refreshing the page
  • Clearing browser cache
  • Trying a different browser
  • Waiting and retrying later
Verify that:
  • You’re still within 30-minute window
  • New password meets requirements (6+ chars, special char)
  • Both password fields match exactly
  • You haven’t modified the email or code

Best Practices

Use Strong Passwords

Choose passwords with 8+ characters, mixing letters, numbers, and symbols

Complete Quickly

Finish the process within 30 minutes to avoid code expiration

Verify Email

Double-check email address before requesting code

Store Securely

Use a password manager to remember new credentials

After Password Reset

Once your password is successfully reset:
1

Return to Login

You’re automatically redirected to the login page after 2 seconds.
2

Login with New Password

Use your email/username and new password to sign in.
3

Verify Access

Confirm you can access your medical data and health plans.
4

Update Password Storage

If using a password manager, update the stored credentials.

Login to Your Account

Access your MediGuide account with your new password

Enter Medical Data

Continue monitoring your health metrics

Security Tips

Protect Your Account:
  • Never share your reset code with anyone
  • Don’t reuse passwords from other sites
  • Change password immediately if you suspect unauthorized access
  • Log out after using shared computers
Password Recommendations:
  • Use a unique password for MediGuide
  • Combine words with numbers and symbols (e.g., “BlueOcean2024!”)
  • Avoid personal info (birthdays, names)
  • Consider using a passphrase: “ILoveCoffee@7am!”

Technical Details

Reset Code Storage

In the database, two fields are used:
  • reset_code: The 6-digit code (cleared after use)
  • reset_code_expiry: Timestamp when code expires

Password Update Process

  1. Verify reset code and expiration
  2. Update password field with new value
  3. Set reset_code to NULL
  4. Set reset_code_expiry to NULL
  5. Return user ID and username

Code Expiration Logic

const expiryTime = new Date(Date.now() + 30 * 60 * 1000);
if (new Date(user.reset_code_expiry) < now) {
  return error('Código expirado');
}

Summary

The password recovery process is:
  1. Secure: Time-limited codes and multi-step verification
  2. User-Friendly: Clear instructions and helpful error messages
  3. Reliable: Validation at each step prevents errors
  4. Fast: Complete in just a few minutes
You now know how to recover your MediGuide account password securely. Keep your email accessible and complete the process promptly!

Build docs developers (and LLMs) love