Skip to content
Snippets Groups Projects
Verified Commit d3eecace authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

[OAuth] Add task to clear expired tokens

parent cac0e3da
No related branches found
No related tags found
1 merge request!938Update DOT to 1.7 and add background task
Pipeline #51975 passed
...@@ -9,6 +9,11 @@ and this project adheres to `Semantic Versioning`_. ...@@ -9,6 +9,11 @@ and this project adheres to `Semantic Versioning`_.
Unreleased Unreleased
---------- ----------
Added
~~~~~
* [OAuth] Expired tokens are now cleared in a periodic task
Fixed Fixed
~~~~~ ~~~~~
......
...@@ -40,3 +40,11 @@ def backup_data() -> None: ...@@ -40,3 +40,11 @@ def backup_data() -> None:
# Hand off to dbbackup's management commands # Hand off to dbbackup's management commands
management.call_command("dbbackup", *db_options) management.call_command("dbbackup", *db_options)
management.call_command("mediabackup", *media_options) management.call_command("mediabackup", *media_options)
@app.task(run_every=timedelta(days=1))
def clear_oauth_tokens():
"""Clear expired OAuth2 tokens."""
from oauth2_provider.models import clear_tokens # noqa
return clear_tokens()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment