Updating checkCredentials and codeRegister