Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PB-267]: Feat/Add lastPasswordChangeAt to users #382

Merged
merged 14 commits into from
Jan 29, 2024

Conversation

larry-internxt
Copy link
Contributor

@larry-internxt larry-internxt commented Feb 27, 2023

  • Added lastPasswordChangeAt column to users
  • Added logic to invalidate token on middleware when lastPasswordChangeAt is greater than token's iat

@larry-internxt larry-internxt requested a review from sg-gs February 27, 2023 19:48
sg-gs
sg-gs previously requested changes Feb 28, 2023
src/app/models/user.ts Outdated Show resolved Hide resolved
@larry-internxt larry-internxt requested a review from sg-gs February 28, 2023 15:55
@larry-internxt larry-internxt changed the title [_]: Feat/Add lastPasswordChangeAt to users [WT-340]: Feat/Add lastPasswordChangeAt to users Mar 7, 2023
@larry-internxt larry-internxt self-assigned this Nov 9, 2023
Copy link

sonarqubecloud bot commented Nov 9, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

@larry-internxt larry-internxt dismissed sg-gs’s stale review November 9, 2023 13:54

already resolved

@sg-gs sg-gs force-pushed the feat/add-lastPasswordChangeAt-to-users branch from 724193e to cca3762 Compare December 19, 2023 12:23
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@sg-gs sg-gs changed the title [WT-340]: Feat/Add lastPasswordChangeAt to users [PB-267]: Feat/Add lastPasswordChangeAt to users Dec 19, 2023
@apsantiso
Copy link
Collaborator

We need to also add iat to new tokens. I made a small PR adding it, moving out the iat from the payload (to align with what drive-server-wip expects) and 1 small naming change.

#422

…o-users-small-changes

[PB-267]: feat/small changes to add future iat to newTokens
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions

0.0% Coverage on New Code (required ≥ 80%)

See analysis details on SonarCloud

@apsantiso
Copy link
Collaborator

apsantiso commented Jan 23, 2024

@sg-gs I think this is ready to go. I just made 3 changes. There are some miliseconds that are being lost when we convert from Date to IAT so that's why this PR issues a new token with a iat a little time ahead. Otherwise, the comparison between lastPassword < iat is going to fail because of the miliseconds.

Other options were:

  1. Remove the milisecons from the new Date() object everytime we set lastPasswordAt. Which is the less cool solution we can take
  2. Add more parameter to update password function to be able to use "iat" as a constructor in the new Date() that is being assigned to lastPasswordAt. e.g: new Date(tokenIat). Exactly as we do in drive-server-wip. However, this require also changing more code.

@larry-internxt larry-internxt merged commit a2b00c5 into master Jan 29, 2024
5 of 10 checks passed
@larry-internxt larry-internxt deleted the feat/add-lastPasswordChangeAt-to-users branch January 29, 2024 16:16
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.

4 participants