webkom / lego

Backend for abakus.no
https://lego.abakus.no
MIT License
54 stars 20 forks source link

Save missing password hash on login #3602

Closed norbye closed 4 months ago

norbye commented 4 months ago

Not the cleanest code out there but for something that has to piggybank on the token generation to be able to generate the hash properly it felt like one of the most reliable ways of doing it as all the important logic is still performed by the rest_framework_jwt.

Open to other suggestions if anyone has any

Will need to be tested in staging to feel better about it, but works just fine for me locally.

The idea is to leave this in prod for a while to generate some hashes, and when the number of missing hashes is low enough we revert the PR.

Resolves ABA-920

linear[bot] commented 4 months ago

ABA-920 Add password hash to the ~500 users who are currently missing one (for wiki and gsuite)

codecov[bot] commented 4 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 89.12%. Comparing base (99fb7e5) to head (1e5b944).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #3602 +/- ## ======================================= Coverage 89.11% 89.12% ======================================= Files 682 682 Lines 21447 21457 +10 ======================================= + Hits 19113 19123 +10 Misses 2334 2334 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

norbye commented 4 months ago

I agree this is an ok way to do it. But maybe add a test?

Absolutely(:

sentry-io[bot] commented 4 months ago

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

Did you find this useful? React with a 👍 or 👎