Fix login functionality