login functionality in frontend and backend