earnest full login function