Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get the choice to remove expiration parameter #40

Open
bastien70 opened this issue Nov 20, 2020 · 9 comments
Open

Get the choice to remove expiration parameter #40

bastien70 opened this issue Nov 20, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@bastien70
Copy link

Hello, it might be interesting to choose whether or not to add an expiration of the email confirmation link.

In my case, this would be useful because the administrator of my application is able to create accounts for his employees. They must confirm their account within 10 days, otherwise I delete the account with a CRON job. But suddenly with the expiration date, it forces them to confirm their account very quickly

@jrushlow
Copy link
Collaborator

Hi @bastien70 - Glad to hear you are using this bundle! I think what you're looking for is the ability to increase the length of time the verification links are valid for. This https://github.com/SymfonyCasts/verify-email-bundle#configuration should help you out with that.

By default, once a user registers, they have 3600 seconds (1 hour) to use the verify link. Changing the lifetime: 3600 configuration param to lifetime: 864000 in your config/packages/verify_email.yaml would increase the link time from 1 hour to 10 days.

If you run into trouble or need further assistance, please feel free to let us know!

@bastien70
Copy link
Author

Thank you for your prompt response !

So I had seen this configuration, but suddenly I have two cases:

  1. That of an administrator account, where I can effectively set the expiration of the link to 1 hour.

  2. That of the sub-accounts created by the admin seen in the previous case.

So I have two different needs. One with a maximum expiration of 1 hour, and the other that would be for 10 days.

In this case, there would be a way to get multiple possible configurations and pass a parameter to say which configuration we want to use for this or that case?

@jrushlow
Copy link
Collaborator

jrushlow commented Nov 20, 2020

hmm that is very interesting. Shooting from the hip - I want to say what you're describing is currently not possible, I'd have to look over our code base to confirm. But it's definitely a good idea and something I have to chew on for a bit to come up with a good implementation.

I think in the meantime, setting the lifetime value to 10 days would handle both use cases. Although the links for the admins themselves would also be 10 days.

@jrushlow jrushlow added the enhancement New feature or request label Nov 20, 2020
@jrushlow
Copy link
Collaborator

For clarity - new feature to allow lifetime configuration changes at runtime in userland.

@bastien70
Copy link
Author

Okay nice I will do that :)

@hyper112
Copy link

Hi @bastien70 - Glad to hear you are using this bundle! I think what you're looking for is the ability to increase the length of time the verification links are valid for. This https://github.com/SymfonyCasts/verify-email-bundle#configuration should help you out with that.

By default, once a user registers, they have 3600 seconds (1 hour) to use the verify link. Changing the lifetime: 3600 configuration param to lifetime: 864000 in your config/packages/verify_email.yaml would increase the link time from 1 hour to 10 days.

If you run into trouble or need further assistance, please feel free to let us know!

Not working for me

@hyper112
Copy link

Hi @bastien70 - Glad to hear you are using this bundle! I think what you're looking for is the ability to increase the length of time the verification links are valid for. This https://github.com/SymfonyCasts/verify-email-bundle#configuration should help you out with that.

By default, once a user registers, they have 3600 seconds (1 hour) to use the verify link. Changing the lifetime: 3600 configuration param to lifetime: 864000 in your config/packages/verify_email.yaml would increase the link time from 1 hour to 10 days.

If you run into trouble or need further assistance, please feel free to let us know!

Are you sure about that becouse it not working

@weaverryan
Copy link
Contributor

It should work - we’re passing the expiration right here - https://github.com/SymfonyCasts/verify-email-bundle/blob/main/src/VerifyEmailHelper.php#L49 - try adding some debug code around there to see what’s going on.

@eidenschink
Copy link

Are you sure about that becouse it not working

Don't forget to clear the cache after changing the configuration (symfony console cache:clear).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants