Expire token (link email) change time


how or where can I change the time?
To change the expiration time of a link.

I think currently after 12 hours a link is no longer valid.
e.g. create password at first registration

thanks a lot

Expiration: Choose an expiration date

Thanks for your answer.
what has a link to share, with my question to do?

i’m about the register of a new user.
The one who gets an e-mail to create a password.
That expires after 12 hours, and I want to change that to 2-3 days.

oh, my mistake, I misread your message.

Do you use a plugin which do not come with owncloud?

hm… this one?

but do this plugin nothing else than overwrite the e-mail templates.
Also here I don’t see any of the data worth a time for an expiration.

couldn’t you set this in config.php?

I just installed the indicated plugin, as you said already is nothing else, will overwrite the e-mail templates.

Digging further into the code in settings/Controller/UsersController.php
You will find the below function:
private function generateTokenAndSendMail($userId, $email)

The link will look something like this:
which I suspect it will create an token with self-containted link time validity.

It’s hardcoded to 12 hours in https://github.com/owncloud/core/blob/master/core/Controller/LostController.php#L172


But that is for lost/reset password, is the same for new user that will have set password?

Honestly, I’m not sure. I’ve quick traced the code and end up there. It’s worth to check.
I think the flow is that the user will have a random generated password, and then it will be reset and sent the link to that email. It’s weird, but it will reuse the same flow for the lost/reset password.

1 Like