-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,405 changed files
with
31,232 additions
and
5,319 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
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,7 +1,11 @@ | ||
/packages/* @RocketChat/chat-engine | ||
/packages/core-typings/ @RocketChat/chat-engine | ||
/packages/rest-typings/ @RocketChat/chat-engine | ||
/packages/ui-contexts/ @RocketChat/frontend | ||
/packages/eslint-config/ @RocketChat/chat-engine | ||
/packages/livechat/ @RocketChat/frontend @RocketChat/chat-engine | ||
/.vscode/ @RocketChat/chat-engine | ||
/.github/ @RocketChat/chat-engine | ||
/_templates/ @RocketChat/chat-engine | ||
/apps/meteor/client/ @RocketChat/frontend | ||
/apps/meteor/tests/ @RocketChat/chat-engine |
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,5 +1,5 @@ | ||
{ | ||
"added": { | ||
"ignore": ["packages/accounts-linkedin/**/*", "packages/linkedin-oauth/**/*", "tests/cypress/integration/08-resolutions.spec.js", "**/.eslintrc.js", "packages/eslint-config/**"] | ||
"ignore": ["packages/accounts-linkedin/**/*", "packages/linkedin-oauth/**/*", "tests/cypress/integration/08-resolutions.spec.js", "**/.eslintrc.js", "packages/eslint-config/**", "**/babel.config.js"] | ||
} | ||
} |
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
Oops, something went wrong.