Needs work
Project:
Node Authorize Link
Version:
2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
20 Sep 2018 at 18:15 UTC
Updated:
14 Aug 2023 at 09:56 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
daniel korteComment #3
daniel korteAdded the option to alter the expiration date after refresh.
Comment #4
tunicThat's a ver interesting feature, thanks for the patch. Unfortunately, it was not handled for along time. Current development is on the branch 2.x, Drupal 10 release.
Comment #7
rishabjasrotia commentedComment #8
rishabjasrotia commentedD10 Patch.
@tunic please review!
Comment #9
tunicI the current approach is reusing the 'created' field in the database to set there the expiration date. Honestly, I'm not fan of reusing fields. I think we should take another approach. Either add a new a database field with expiration date or rename the 'created' field to 'expiration'. In both cases, the 'expiration' date should handled to hold the date the authkey should be refreshed.
So, for nodes with no expiration this field should be empty. For nodes with expiration configured, it will set to an expiration date calculated adding expiration time (1 day, 1 week, 1 year, etc) to the current date (or creation date, it should be the same when creating an authkey). During this time span, the authkey is valid, and once the expiration time is reached the authkey is regenerated.
Given that would interesting to have the creation time we can go with the option of creating a new field.
If there's a refresh configuration, whenever a node is accessed, the expiration time is changed with the value current data + refresh time. So, if the refresh time one day the expiration date is set to tomorrow.
Also, I would improve the messages in the form. For example, "After refreshing a link, the expiration date will be extended (or shortened) by this time length." is confusing me. Extended or shortened? I would say something like "After refreshing a link, a new expiration date will be set based on the expiration extension set. For example, if expiration extension is set to 1 day, when a node is accessed using its authkey the expiration time will be set to the next day.". I think that is clearer than current message.
What do think about this?
Comment #11
rishabjasrotia commentedComment #12
rishabjasrotia commented