Fixed login bug after authentication