All registration process in opencart are in model:
catalog/model/account/customer.php
function addCustomer
$this->db->query("INSERT INTO " . DB_PREFIX . "customer SET customer_group_id = '" . (int)$customer_group_id . "', store_id = '" . (int)$this->config->get('config_store_id') . "', language_id = '" . (int)$this->config->get('config_language_id') . "', firstname = '" . $this->db->escape($data['firstname']) . "', lastname = '" . $this->db->escape($data['lastname']) . "', email = '" . $this->db->escape($data['email']) . "', telephone = '" . $this->db->escape($data['telephone']) . "', fax = '" . $this->db->escape($data['fax']) . "', custom_field = '" . $this->db->escape(isset($data['custom_field']['account']) ? json_encode($data['custom_field']['account']) : '') . "', salt = '" . $this->db->escape($salt = token(9)) . "', password = '" . $this->db->escape(sha1($salt . sha1($salt . sha1($data['password'])))) . "', newsletter = '" . (isset($data['newsletter']) ? (int)$data['newsletter'] : 0) . "', ip = '" . $this->db->escape($this->request->server['REMOTE_ADDR']) . "', status = '1', approved = '" . (int)!$customer_group_info['approval'] . "', date_added = NOW()");
All login proccess in opencart are in library system/library/cart/customer.php
function login
if ($override) {
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND status = '1'");
} else {
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(utf8_strtolower($email)) . "' AND (password = SHA1(CONCAT(salt, SHA1(CONCAT(salt, SHA1('" . $this->db->escape($password) . "'))))) OR password = '" . $this->db->escape(md5($password)) . "') AND status = '1' AND approved = '1'");
}
Parametr $override is used for login without password from admin panel by token..
Token are one-time and are cleared after login..
Some code about this proccess are in controller catalog/controller/account/login.php
if (!empty($this->request->get['token'])) {
.....
$customer_info = $this->model_account_customer->getCustomerByToken($this->request->get['token']); // find customer by token
You can use some hash from user device as password, this solution will be more secure than login with not encoded otp password... You may use otp password only for verify phone number
UPDATE:
You can generate user token in application, than update opencart db from application with request:
"UPDATE " . DB_PREFIX . "customer SET token = 'token_for_user' WHERE telephone = 'user_telephone" by user telephone.. OR "UPDATE " . DB_PREFIX . "customer SET token = 'token_for_user' WHERE email = 'user_email" by user_email ...
Than make GET request http://your-site.com/index.php?route=account/login&token=generated_token ... After this request user session will be created.. Email/telephone number will be needed only for token update... Login will be only by generated token, no any other data needed, as works now login from admin panel to the customer's account..