Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
cleanUpExpiredRefreshTokens example
'expires_at' => ':expiresAt',
]
)
->
setParameters
(
[
'id' => Uuid::
randomBytes
(
)
,
'userId' => Uuid::
fromHexToBytes
(
$refreshTokenEntity
->
getAccessToken
(
)
->
getUserIdentifier
(
)
)
,
'tokenId' =>
$refreshTokenEntity
->
getIdentifier
(
)
,
'issuedAt'
=>
(
new
\
DateTime
(
)
)
->
format
(
Defaults::STORAGE_DATE_TIME_FORMAT
)
,
'expiresAt' =>
$refreshTokenEntity
->
getExpiryDateTime
(
)
->
format
(
Defaults::STORAGE_DATE_TIME_FORMAT
)
,
]
)
->
executeStatement
(
)
;
$this
->
cleanUpExpiredRefreshTokens
(
)
;
}
/** * {@inheritdoc} */
public
function
revokeRefreshToken
(
$tokenId
)
: void
{
$this
->connection->
createQueryBuilder
(
)
->
delete
(
'refresh_token'
)
->
where
(
'token_id = :tokenId'
)
->
setParameter
(
'tokenId',
$tokenId
)