Allow Expiry Links to have Different Expiry Dates

Created on 3 December 2021, about 3 years ago
Updated 28 June 2024, 6 months ago

Problem/Motivation

I have two types of auto-login links, one type that I want to expire after 2 days and one type that I want to expire after 1 week.

Currently, the module does not support this use case.

Proposed resolution

I propose that the auto-login links store the expiry date instead of the created date.

Then, when using a service, we could allow another parameter to custom set the time to expire the link.

Remaining tasks

  1. Refactor module to store expiry date.
  2. Update autologinurl.create API (and the function alias) to allow optional parameter to override the default expiry date.
  3. Add tests.

User interface changes

Users can still set a default expiry date, but updating the expiry date would not apply to existing auto-login links.

E.g. if an auto-login link was going to expire today and you added another 24 * 3600 seconds to the expiry date, the link would expire tomorrow. Storing the expiry date would remove this behaviour.

API changes

The autologinurl.create service (and its function alias) would have an optional parameter to override the expiry date.

Data model changes

Instead of storing the creation date, you would store the expiry date.

Feature request
Status

Needs review

Version

2.0

Component

Code

Created by

🇨🇦Canada Nathan Tsai

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • I think it's a good idea that hasn't been realized yet. I'll change the branch to the latest 2.0.0-alpha3 and try to make a patch.

  • Merge request !22Allow expire time for each link → (Open) created by kuzyawkk
  • Pipeline finished with Success
    6 months ago
    Total: 160s
    #210995
  • Issue was unassigned.
  • Status changed to Needs review 6 months ago
  • Added the ability to pass a parameter with an expiration value that will be stored in the database. If you do not pass anything, the value from the configuration will be pulled up. Also, wrote a hook_update_N that transfers values from the configuration to the database for all fields.

Production build 0.71.5 2024