login and credential check