Polish login logic
Merge pull request #11 from ivanzhaowy/master

Polish login logic