accounts icon indicating copy to clipboard operation
accounts copied to clipboard

feat(mongo)!: ttl for reset password tokens

Open pradel opened this issue 3 years ago • 2 comments

BREAKING CHANGE: Upgrading to this version will invalidate all the existing reset password tokens.

Once you updated the dependency in your project and deployed your server, to cleanup the database and remove the old reset password tokens run:

db.collection('users').updateMany({}, { $unset: { 'services.password.reset': '' } });

Related to #935

pradel avatar Dec 12 '20 14:12 pradel

I am not really happy with this approach, would be better if the password module sends the expiration date for the token, will try with another approach.

Edit: solved

pradel avatar Dec 12 '20 16:12 pradel

Codecov Report

Merging #1081 (f6937a6) into master (35c4c8c) will decrease coverage by 0.02%. The diff coverage is 95.23%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1081      +/-   ##
==========================================
- Coverage   95.53%   95.50%   -0.03%     
==========================================
  Files          93       93              
  Lines        2150     2159       +9     
  Branches      424      426       +2     
==========================================
+ Hits         2054     2062       +8     
- Misses         94       95       +1     
  Partials        2        2              
Impacted Files Coverage Δ
...ages/database-mongo-password/src/mongo-password.ts 98.97% <94.11%> (-1.03%) :arrow_down:
packages/database-mongo/src/mongo.ts 98.71% <100.00%> (ø)
packages/password/src/accounts-password.ts 91.46% <100.00%> (ø)

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 35c4c8c...f6937a6. Read the comment docs.

codecov[bot] avatar Dec 13 '20 14:12 codecov[bot]