complete login function
complete login function