wagnerdelima / drf-social-oauth2

drf-social-oauth2 makes it easy to integrate Django social authentication with major OAuth2 providers, i.e., Facebook, Twitter, Google, etc.
https://drf-social-oauth2.readthedocs.io/en/latest/
MIT License
271 stars 34 forks source link

Deleting old tokens #132

Closed samul-1 closed 1 year ago

samul-1 commented 2 years ago

I find old, expired access tokens piling up pretty fast in my application, which takes up unnecessary database space.

I believe this package could use being shipped with a task to delete expired tokens. It could be run with celery beat or something else to periodically clean the table.

Would this make sense? If so, I'd be happy to work on a solution myself and possibly pull request here.

wagnerdelima commented 2 years ago

Hi @samul-1,

Thank you for your suggestions. Your suggestion is a great idea. I would really appreciate if you could do it. But it needs to be a full-fledged solution. For example, I would encourage celery, celery-beat and the broker (redis or rabbitmq) to be used in containers. Furthermore, it needs to offer a condition to the developers in case the opt-out of using the periodic task to remove the tokens. I mean, some people might not just be comfortable with the idea of including other layers of software (beat, celery, rabbit etc) just to get tokens removed.

Let me know what you think.