Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
updatePasswordHash example
public
function
getCustomerByLogin
(
string
$email
, string
$password
, SalesChannelContext
$context
)
: CustomerEntity
{
$customer
=
$this
->
getCustomerByEmail
(
$email
,
$context
)
;
if
(
$customer
->
hasLegacyPassword
(
)
)
{
if
(
!
$this
->legacyPasswordVerifier->
verify
(
$password
,
$customer
)
)
{
throw
CustomerException::
badCredentials
(
)
;
}
$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