Implement the missing login logic and ui