There is a bug, resulting in the Magic Link functionality not working for certain timezones. Craft saves DB entries in UTC. Therefore in certain timezones, a magic link will always be expired.
I believe the fix is as follows. On line 196 in MagicLink.php replace:
if (DateTimeHelper::currentTimeStamp() <= (strtotime($query->dateCreated) + $this->settings->magicLinkExpirySeconds))
With:
if (DateTimeHelper::currentTimeStamp() <= (DateTimeHelper::toDateTime($query->dateCreated)->format('U') + $this->settings->magicLinkExpirySeconds))
Hope this helps. Would be great if you can update the plugin.
Hi bymayo,
There is a bug, resulting in the Magic Link functionality not working for certain timezones. Craft saves DB entries in UTC. Therefore in certain timezones, a magic link will always be expired.
I believe the fix is as follows. On line 196 in MagicLink.php replace:
if (DateTimeHelper::currentTimeStamp() <= (strtotime($query->dateCreated) + $this->settings->magicLinkExpirySeconds))
With:
if (DateTimeHelper::currentTimeStamp() <= (DateTimeHelper::toDateTime($query->dateCreated)->format('U') + $this->settings->magicLinkExpirySeconds))
Hope this helps. Would be great if you can update the plugin.