-
Notifications
You must be signed in to change notification settings - Fork 57
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
allow for multiple MAX_AGE values #57
Comments
It's unfortunate that django-sesame relies so heavily on global settings, however:
If you try to implement what you're proposing you'll discover that it triggers large code changes, because the timestamp checking code runs before attempting to load the User instance. I have two ideas that may do the job more easily:
You didn't tell how you were using django-sesame exactly. If you have a basic setup with the middleware, try option 1. If you're handling tokens in your own code, try option 2. |
hey, thx for the timely answer. My 5 dimes:
My initial intention actually didn't need the user, just based on url path would have been sufficient... so a simple request object would have been sufficient with a callback logic. Re you're ideas:
right, but haven't upgraded yet. when the new version came out my tests started failing and I quickly pinned back to the old version, didn't had time yet to investigate why. Will do later this year. Quickly checked the README and yes a general 2.0 release note is there, but a handy step-by-step-no-need-for-thinking upgrade/migration guide would have been fantastic. As I wasn't patient enough to wait for an answer (you never know in open source when you get one) - I stumpled upon a short note by yourself regarding the From my perspective this a) uses From my side we can close this ticket here, if you agree... |
Your approach looks very smart for your use case. Re. the v1 => v2 upgrade: do a replace-all of |
btw. if you come to be around Dresden, Germany. You must ping me for a coffee! |
hey, coming back here... looks like your magic links are really being loved by my apps users. they now asked me to have those urls printed on thousands of papers as QR code. so now I really have to have different expiration times for those urls. I assume putting the time/date into the encrypted string is a stupid idea (to prevent some kind of local storage), isn't it? |
I filed #67 because I think this use case should have built-in support. |
(The only reason why I rejected this issue earlier is because it required a bit of effort to implement, not because it's a bad idea.) |
wow. that would be fantastic. let me me be your early alpha tester :) |
Hey, using your lib for a long time already. Great job!
I'm having two different scenarios for two user groups to use
django_sesame
access pattern. But theMAX_AGE
should be different for them (10m vs. 24h). Can we make this value more flexible? E.g. can we allowSESAME_MAX_AGE
to be a callback gettingrequest
andUser()
objects?Many thx in advance!
The text was updated successfully, but these errors were encountered: