adds a login function.