Skip to content

Upgrading from 3.x to 4.x: migrating ValidationData with $currentTime #812

Closed

Description

@ozahorulia

Hello! I'm migrating code written by another developer, and I can see several validation calls, which look like this:

    $validationData = new ValidationData($this->getNowTime() + self::TTL_TIME_LIMIT);
    if (!$token->validate($validationData)) {
        // ...
    }

    $validationData = new ValidationData($this->getNowTime());
    if (!$token->validate($validationData)) {
        // ...
    }

From the upgrading steps I can see that validation is now done like this:

!$this->configuration->validator()->validate($token, ...$this->configuration->validationConstraints())

But I can not see how can I pass the $currentTime argument with new API. And as you can see, in the old code it's not always an actual current time as in the first call (as I understand it's done to see if token will be expired during the next hour).

Any solution for smooth migration in this case?

Activity

  1. changed the title [-]Upgrading to from 3.x to 4.x: migrating ValidationData with $currentTime[/-] [+]Upgrading from 3.x to 4.x: migrating ValidationData with $currentTime[/+] on Jan 6, 2022
  2. Repository owner locked and limited conversation to collaborators on Jan 10, 2022
  3. converted this issue into a discussion #813 on Jan 10, 2022
  4. Repository owner unlocked this conversation on Jan 10, 2022
  5. Repository owner locked as resolved and limited conversation to collaborators on Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions