Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
invalidateUsingSession example
foreach
(
$event
->
getWriteResults
(
)
as
$writeResult
)
{
if
(
$writeResult
->
getOperation
(
)
!== EntityWriteResult::OPERATION_UPDATE
)
{
continue
;
}
$payload
=
$writeResult
->
getPayload
(
)
;
if
(
!
$this
->
customerCredentialsChanged
(
$payload
)
)
{
continue
;
}
$customerId
=
$payload
[
'id'
]
;
$newToken
=
$this
->
invalidateUsingSession
(
$customerId
)
;
if
(
$newToken
)
{
$this
->contextPersister->
revokeAllCustomerTokens
(
$customerId
,
$newToken
)
;
}
else
{
$this
->contextPersister->
revokeAllCustomerTokens
(
$customerId
)
;
}
}
}
public
function
onCustomerDeleted
(
EntityDeletedEvent
$event
)
: void
{