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
- Refactor module to store expiry date.
- Update
autologinurl.create
API (and the function alias) to allow optional parameter to override the default expiry date.
- 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.