Skip to content

ResetPasswordToken -> getExpiresAtIntervalInstance() - timezone problem #241

Closed
@gaetshun

Description

@gaetshun

It seems there is a Timezone problem. In fact, there is a problem when you try to get a DateInterval between createdAt and expireAt.

1- createdAt (generatedAt) is a timestamp and when you try to create the DateTimeImmutable => the timezone used is UTC.
2 - expireAt use the timezone by default on the server (in my case Europe/Paris). this is a problem when you try to make a diff between these two DateTimeInterface.

For me the good solution will be to get resquestedAt variable from passwordResetRequest object for generating the ResetPasswordToken object.

the quick solution would be to put in the function getExpiresAtIntervalInstance() "$createdAtTime=$createdAtTime->setTimezone($this->expiresAt->getTimezone());"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions