Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isCustomerConfirmed example
$this
->
updatePasswordHash
(
$password
,
$customer
,
$context
->
getContext
(
)
)
;
return
$customer
;
}
if
(
$customer
->
getPassword
(
)
=== null
|| !
password_verify
(
$password
,
$customer
->
getPassword
(
)
)
)
{
throw
CustomerException::
badCredentials
(
)
;
}
if
(
!
$this
->
isCustomerConfirmed
(
$customer
)
)
{
// Make sure to only throw this exception after it has been verified it was a valid login
throw
CustomerException::
customerOptinNotCompleted
(
$customer
->
getId
(
)
)
;
}
return
$customer
;
}
private
function
isCustomerConfirmed
(
CustomerEntity
$customer
)
: bool
{
return
!
$customer
->
getDoubleOptInRegistration
(
)
||
$customer
->
getDoubleOptInConfirmDate
(
)
;
}