Rewrite login function with test