Fixed login on upgrade not working on first try.

Signed-off-by: jdarwood007 <github@sleepycode.com>
Merge pull request #568 from jdarwood007/upgrade-login-fix

 Fixed login on upgrade not working on first try.