sample code for login