Skip to content

Conversation

Pankrat
Copy link
Contributor

@Pankrat Pankrat commented Nov 17, 2022

The cleartokens management command removed expired refresh tokens and associated access tokens but kept expired ID tokens in the database.

Remove ID tokens when the associated access and refresh tokens are cleared.

Preserve expired tokens until the associated access token is deleted to keep relationships intact and not trigger delete cascades.

Fixes #1222

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

The `cleartokens` management command removed expired refresh tokens and
associated access tokens but kept expired ID tokens in the database.

Remove ID tokens when the associated access and refresh tokens are
cleared. Preserve expired ID tokens until the associated access token is
deleted to keep relationships intact and not trigger delete cascades.

Fixes django-oauth#1222
@Pankrat Pankrat force-pushed the clear-expired-id-tokens branch from 0a4382d to 80f8af2 Compare November 18, 2022 09:21
@codecov
Copy link

codecov bot commented Nov 18, 2022

Codecov Report

Merging #1223 (80f8af2) into master (e0c2fc8) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #1223   +/-   ##
=======================================
  Coverage   96.20%   96.20%           
=======================================
  Files          26       26           
  Lines        1317     1317           
=======================================
  Hits         1267     1267           
  Misses         50       50           

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@n2ygk n2ygk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great stuff. Thanks for this!

@n2ygk n2ygk merged commit a2b7bee into django-oauth:master Nov 18, 2022
@n2ygk n2ygk added this to the Future milestone Feb 12, 2023
@n2ygk n2ygk modified the milestones: Future, 2.3.0 May 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expired ID tokens are not removed

2 participants