Correct refresh behavior to store new credential