-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' of github.com:RocketChat/Rocket.Chat into fix/…
…lists * 'develop' of github.com:RocketChat/Rocket.Chat: Chore: Move markdown message parser to a `callback` (#25413) [FIX] Settings listeners not receiving overwritten values from env vars (#25448) Chore: Move ddp-streamer micro service to its own sub-repo (#25246) [NEW] Use setting to determine if initial general channel is needed (#25441) [IMPROVE] New admin settings Page (#25439) [FIX] Failure to update Integration History index (#25473) Chore: Rewrite 2fa to typescript (#25285) Chore: solve yarn issues from env var (#25468) Chore: REST query and body params validation (#25446) Chore: Tests with Playwright (task: ROC-66, Intermittent resolution in tests) (#25416) Chore: Convert email inbox feature to TypeScript (#25298)
- Loading branch information
Showing
130 changed files
with
1,488 additions
and
830 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -85,3 +85,4 @@ coverage | |
.nyc_output | ||
/data | ||
tests/e2e/test-failures/ | ||
out.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 11 additions & 4 deletions
15
.../meteor/app/2fa/server/methods/disable.js → .../meteor/app/2fa/server/methods/disable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,34 @@ | ||
import { Meteor } from 'meteor/meteor'; | ||
|
||
import { Users } from '../../../models'; | ||
import { Users } from '../../../models/server'; | ||
import { TOTP } from '../lib/totp'; | ||
|
||
Meteor.methods({ | ||
'2fa:disable'(code) { | ||
if (!Meteor.userId()) { | ||
const userId = Meteor.userId(); | ||
if (!userId) { | ||
throw new Meteor.Error('not-authorized'); | ||
} | ||
|
||
const user = Meteor.user(); | ||
|
||
if (!user) { | ||
throw new Meteor.Error('error-invalid-user', 'Invalid user', { | ||
method: '2fa:disable', | ||
}); | ||
} | ||
|
||
const verified = TOTP.verify({ | ||
secret: user.services.totp.secret, | ||
token: code, | ||
userId: Meteor.userId(), | ||
userId, | ||
backupTokens: user.services.totp.hashedBackup, | ||
}); | ||
|
||
if (!verified) { | ||
return false; | ||
} | ||
|
||
return Users.disable2FAByUserId(Meteor.userId()); | ||
return Users.disable2FAByUserId(userId); | ||
}, | ||
}); |
13 changes: 10 additions & 3 deletions
13
apps/meteor/app/2fa/server/methods/enable.js → apps/meteor/app/2fa/server/methods/enable.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 8 additions & 2 deletions
10
...p/2fa/server/methods/validateTempToken.js → ...p/2fa/server/methods/validateTempToken.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.