function deleteToken(PersistentToken $token) not working

Created on 8 November 2023, about 1 year ago

Problem/Motivation

When trying to delete a token the functions creates a hash on an already hashed token. Therefore the token is not deleted in the database.

Proposed resolution

Remove the additional hash function in the deleteToken function:

-        ->condition('series', Crypt::hashBase64($token->getSeries()))
+        ->condition('series', $token->getSeries())

Remaining tasks

On top of that, it would be great to implement a hook_user_delete() to delete all data for the deleted user stored in the persistent_login database table.

This would also fix: https://www.drupal.org/project/persistent_login/issues/3399159 🐛 Deleting user throws type error in loadTokenOnRequestEvent Active

on a more cleaner way on the perspective of datasecurity/datapolicy

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany slowflyer

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024