<?xml version="1.0"?>
<!--
/**
 * A Magento 2 module named Magestat/SigninPhoneNumber
 * Copyright (C) 2019 Magestat
 *
 * This file included in Magestat/SigninWithPhoneNumber is licensed under OSL 3.0
 *
 * http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 * Please see LICENSE.txt for the full text of the OSL 3.0 license
 */
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <!-- API Preferences -->
    <preference for="Magestat\SigninPhoneNumber\Api\SigninInterface" type="Magestat\SigninPhoneNumber\Model\Handler\Signin"/>
    <!-- Overrides -->
    <preference for="Magento\Customer\Api\AccountManagementInterface" type="Magestat\SigninPhoneNumber\Model\AccountManagement" />
    <preference for="Magento\Customer\Block\Form\Login" type="Magestat\SigninPhoneNumber\Block\Form\Login"/>

    <type name="Magento\Customer\Model\ResourceModel\Customer">
        <plugin name="magestat_validate_unique_phonenumber" type="Magestat\SigninPhoneNumber\Plugin\Model\ResourceModel\Customer\ValidateUniquePhonenumber" sortOrder="10" disabled="false"  />
    </type>
    <preference for="Magento\Customer\Controller\Account\ForgotPasswordPost" type="Magestat\SigninPhoneNumber\Controller\Account\ForgotPasswordPost" />
    <preference for="Magento\Customer\Controller\Account\EditPost" type="Magestat\SigninPhoneNumber\Controller\Account\EditPost" />
</config>
