Uuid/Ulid are supported as Doctrine types since Symfony 5.2, but when a User Entity uses them as its identifier, the strict comparison of the identifier in AbstractToken::hasUserChanged() fails unless the User Entity implements EquatableInterface and does the whole comparison itself. In effect, the user is always assumed as changed and logged out.
This change implements a check, if the getUserIdentifier()
method of the User Entity returns an object with an equals
method and uses that for the comparison instead of the strict !==
operator, that is always true for two different Uuid/Ulid objects, even if they contain the same uid.