A password-reset link is effectively a temporary credential. OWASP recommends generating reset tokens with a cryptographically secure random number generator, making them long enough to resist brute force, binding each token to one user, storing it securely, and invalidating it after use. Tokens should expire after an appropriate period. A secure reset flow should also use HTTPS, avoid building reset URLs from an untrusted Host header, prevent token leakage through referrer headers, and rate-limit requests. Return consistent responses for existing and non-existing accounts so the endpoint cannot be used for account enumeration. Treat password recovery as part of authentication security, not as a harmless email feature. Source: OWASP Foundation