Fixed infinity login loop

related to #27