ueberauth / guardian_db

Guardian DB integration for tracking tokens and ensuring logout cannot be replayed.
MIT License
368 stars 87 forks source link

handle stale ecto errors on delete #103

Closed rraub closed 5 years ago

rraub commented 5 years ago

Addresses #102

Looks like we can pass an option to Ecto.Repo.delete/2 that will map a stale error into a field in the change set.

yordis commented 5 years ago

@rraub Travis is failing

rraub commented 5 years ago

😞 Looks like I'll have to get the test suit running locally to do some more testing..

codecov-io commented 5 years ago

Codecov Report

Merging #103 into master will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #103   +/-   ##
=====================================
  Coverage      80%    80%           
=====================================
  Files           5      5           
  Lines          60     60           
=====================================
  Hits           48     48           
  Misses         12     12
Impacted Files Coverage Δ
lib/guardian/db.ex 93.33% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 0b86831...e797d12. Read the comment docs.

rraub commented 5 years ago

Alright I figured out why the tests wont work, since the on_revoke looks up the token before deleting if it doesn't find one it no-ops. So unless we make destroy_token/3 no longer private we can't really test this new behavior. We will have to trust Ecto for this.

doomspork commented 5 years ago

@rraub I'm going to give the other @ueberauth/developers a chance to review this change before merging. Sorry for the delay 😁