implemented login with authenticate