modify a little on login logic to fit coding style
Merge pull request #45 from juniwang/dev

modify a little on login logic to fit coding style