password_needs_rehash

password_hash has a function for needs_rehash. When should I call it? After successful login?