Refresh link expiration date after first use

Created on 20 September 2018, over 6 years ago
Updated 14 August 2023, over 1 year ago

Problem/Motivation

I recently had a requirement that the authorize links expire 24 hours after the first use rather than 24 hours after creation.

Proposed resolution

Add a 'Refresh' option to the Content type configuration tab that will extend a link’s expiration date based on first use.

✨ Feature request
Status

Needs work

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States daniel korte Brooklyn, NY

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ͺπŸ‡ΈSpain tunic Madrid

    That'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.

  • First commit to issue fork.
  • @rishabjasrotia opened merge request.
  • Assigned to rishabjasrotia
  • Status changed to Needs review over 1 year ago
  • D10 Patch.
    @tunic please review!

  • Status changed to Needs work over 1 year ago
  • πŸ‡ͺπŸ‡ΈSpain tunic Madrid

    I 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?

  • Issue was unassigned.
  • Assigned to rishabjasrotia
  • @rishabjasrotia opened merge request.
Production build 0.71.5 2024