Skip to content

Commit

Permalink
Merge branch 'develop' into ooo-v1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-mitra committed Jul 5, 2021
2 parents 47bea6c + f823590 commit 6ef35ed
Show file tree
Hide file tree
Showing 258 changed files with 11,392 additions and 15,854 deletions.
2 changes: 1 addition & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public/livechat/
!.scripts
public/pdf.worker.min.js
public/workers/**/*
imports/client/
imports/client/**/*
!/.storybook/
ee/server/services/dist/**
!/.mocharc.js
Expand Down
2 changes: 2 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@
"prefer-single"
],
"indent": "off",
"no-dupe-class-members": "off",
"no-extra-parens": "off",
"no-spaced-func": "off",
"no-unused-vars": "off",
Expand Down Expand Up @@ -116,6 +117,7 @@
"enforceForArrowConditionals": false
}
],
"@typescript-eslint/no-dupe-class-members": "error",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": ["error", {
"argsIgnorePattern": "^_",
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
path: |
./node_modules
./ee/server/services/node_modules
key: ${{ runner.OS }}-node_modules-2-${{ hashFiles('**/package-lock.json', '.github/workflows/build_and_test.yml') }}
key: ${{ runner.OS }}-node_modules-4-${{ hashFiles('**/package-lock.json', '.github/workflows/build_and_test.yml') }}

- name: Cache meteor local
uses: actions/cache@v2
Expand Down Expand Up @@ -242,7 +242,7 @@ jobs:
path: |
./node_modules
./ee/server/services/node_modules
key: ${{ runner.OS }}-node_modules-2-${{ hashFiles('**/package-lock.json', '.github/workflows/build_and_test.yml') }}
key: ${{ runner.OS }}-node_modules-4-${{ hashFiles('**/package-lock.json', '.github/workflows/build_and_test.yml') }}

- name: NPM install
if: steps.cache-nodemodules.outputs.cache-hit != 'true' || steps.cache-cypress.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -306,7 +306,7 @@ jobs:
path: |
./node_modules
./ee/server/services/node_modules
key: ${{ runner.OS }}-node_modules-2-${{ hashFiles('**/package-lock.json', '.github/workflows/build_and_test.yml') }}
key: ${{ runner.OS }}-node_modules-4-${{ hashFiles('**/package-lock.json', '.github/workflows/build_and_test.yml') }}

- name: Cache meteor local
uses: actions/cache@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
no-response:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected].18
- uses: actions/[email protected].19
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
days-before-stale: 10
Expand All @@ -26,7 +26,7 @@ jobs:
# stale:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/[email protected].18
# - uses: actions/[email protected].19
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}
# days-before-stale: 60
Expand Down
14 changes: 7 additions & 7 deletions .meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ [email protected]
[email protected]
[email protected]
[email protected]
[email protected].0
typescript@4.1.2
[email protected].1
typescript@4.2.2
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
mongo@1.10.1
mongo@1.11.0
[email protected]
[email protected]
[email protected]
Expand Down Expand Up @@ -62,16 +62,16 @@ pauli:accounts-linkedin
raix:handlebar-helpers
raix:ui-dropped-event

rocketchat:tap-i18n
rocketchat:tap-i18n@1.10.1
[email protected]
littledata:synced-cron

edgee:slingshot
jalik:[email protected]
accounts-base@1.8.0
accounts-base@1.9.0
[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
htmljs
less
Expand All @@ -82,7 +82,7 @@ [email protected]
[email protected]
[email protected]
templating
[email protected].0
[email protected].1
[email protected]
rocketchat:oauth2-server
rocketchat:i18n
Expand Down
2 changes: 1 addition & 1 deletion .meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
METEOR@2.1.1
METEOR@2.2
76 changes: 38 additions & 38 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -1,70 +1,70 @@
accounts-base@1.8.0
accounts-base@1.9.0
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
aldeed:[email protected]
[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
[email protected]
[email protected]
blaze@2.3.4
blaze-html-templates@1.1.2
blaze-tools@1.0.10
blaze@2.5.0
blaze-html-templates@1.2.1
blaze-tools@1.1.2
[email protected]
[email protected]
caching-html-compiler@1.1.3
caching-html-compiler@1.2.0
[email protected]
cfs:[email protected]
[email protected]
[email protected]
dandv:[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
[email protected]
[email protected].2
[email protected].3
[email protected]
[email protected]
dispatch:[email protected]
[email protected]
[email protected].0
[email protected].1
[email protected]
[email protected].0
[email protected].0
[email protected].1
[email protected].1
edgee:[email protected]
[email protected]
[email protected]
[email protected]
facebook-oauth@1.7.4
facebook-oauth@1.8.0
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
html-tools@1.0.11
htmljs@1.0.11
[email protected].3
[email protected].0
html-tools@1.1.2
htmljs@1.1.1
[email protected].4
[email protected].1
[email protected]
jalik:[email protected]
jalik:[email protected]
jalik:[email protected]
jparker:[email protected]
jparker:[email protected]
jparker:[email protected]
jquery@1.11.11
jquery@3.0.0
kadira:[email protected]
konecty:[email protected]
konecty:[email protected]
[email protected].0
[email protected].1
[email protected]
littledata:[email protected]
[email protected]
Expand All @@ -75,27 +75,27 @@ mdg:[email protected]
[email protected]
[email protected]
[email protected]
meteorhacks:[email protected].4
meteorhacks:[email protected].5
meteorspark:[email protected]
[email protected].3
[email protected].4
[email protected]
[email protected].1
[email protected].2
mizzao:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
mongo@1.10.1
mongo@1.11.1
[email protected]
[email protected]
[email protected].7
[email protected].8
mrt:[email protected]
mystor:[email protected]
nimble:[email protected]
nooitaf:[email protected]_1
[email protected].3
npm-mongo@3.8.1
[email protected].4
npm-mongo@3.9.0
[email protected]
[email protected]
[email protected]
Expand All @@ -105,7 +105,7 @@ ostrio:[email protected]
pauli:[email protected]
pauli:[email protected]
[email protected]
raix:eventemitter@0.1.3
raix:eventemitter@1.0.0
raix:[email protected]
raix:[email protected]
[email protected]
Expand All @@ -122,28 +122,28 @@ rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:[email protected]
rocketchat:tap-i18n@1.9.1
rocketchat:tap-i18n@1.10.1
rocketchat:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
simple:[email protected]
[email protected].1
spacebars@1.0.15
spacebars-compiler@1.1.3
[email protected].3
spacebars@1.2.0
spacebars-compiler@1.2.1
[email protected]
[email protected]
templating@1.3.2
templating-compiler@1.3.3
templating-runtime@1.3.2
templating-tools@1.1.2
templating@1.4.1
templating-compiler@1.4.1
templating-runtime@1.5.0
templating-tools@1.2.0
[email protected]
[email protected]
typescript@4.1.2
typescript@4.2.2
[email protected]
[email protected]
[email protected].1
[email protected].0
[email protected].2
[email protected].1
[email protected]
1 change: 0 additions & 1 deletion .postcssrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"preserve": true
},
"postcss-media-minmax": {},
"postcss-selector-not": {},
"postcss-nested": {},
"autoprefixer": {}
},
Expand Down
1 change: 0 additions & 1 deletion .storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = {
plugins: [
require('postcss-custom-properties')({ preserve: true }),
require('postcss-media-minmax')(),
require('postcss-selector-not')(),
require('postcss-nested')(),
require('autoprefixer')(),
require('postcss-url')({ url: ({ absolutePath, relativePath, url }) => {
Expand Down
59 changes: 16 additions & 43 deletions app/2fa/client/callWithTwoFactorRequired.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,10 @@ import { Meteor } from 'meteor/meteor';
import { SHA256 } from 'meteor/sha';
import toastr from 'toastr';

import { modal } from '../../ui-utils/client';
import { t, APIClient } from '../../utils/client';
import { t } from '../../utils/client';
import { imperativeModal } from '../../../client/lib/imperativeModal';
import TwoFactorModal from '../../../client/components/TwoFactorModal';

const methods = {
totp: {
text: 'Open_your_authentication_app_and_enter_the_code',
},
email: {
text: 'Verify_your_email_for_the_code_we_sent',
html: true,
},
password: {
title: 'Please_enter_your_password',
text: 'For_your_security_you_must_enter_your_current_password_to_continue',
inputType: 'password',
},
};

export function process2faReturn({ error, result, originalCallback, onCode, emailOrUsername }) {
if (!error || (error.error !== 'totp-required' && error.errorType !== 'totp-required')) {
Expand All @@ -31,34 +18,20 @@ export function process2faReturn({ error, result, originalCallback, onCode, emai
emailOrUsername = Meteor.user().username;
}

modal.open({
title: t(methods[method].title || 'Two Factor Authentication'),
text: t(methods[method].text),
html: methods[method].html,
type: 'input',
inputActionText: method === 'email' && emailOrUsername && t('Send_me_the_code_again'),
async inputAction(e) {
const { value } = e.currentTarget;
e.currentTarget.value = t('Sending');

await APIClient.v1.post('users.2fa.sendEmailCode', { emailOrUsername });

e.currentTarget.value = value;
imperativeModal.open({
component: TwoFactorModal,
props: {
method,
onConfirm: (code, method) => {
onCode(method === 'password' ? SHA256(code) : code, method);
imperativeModal.close();
},
onClose: () => {
imperativeModal.close();
originalCallback(new Meteor.Error('totp-canceled'));
},
emailOrUsername,
},
inputType: methods[method].inputType || 'text',
showCancelButton: true,
closeOnConfirm: true,
confirmButtonText: t('Verify'),
cancelButtonText: t('Cancel'),
}, (code) => {
if (code === false) {
return originalCallback(new Meteor.Error('totp-canceled'));
}

if (method === 'password') {
code = SHA256(code);
}
onCode(code, method);
});
}

Expand Down
2 changes: 1 addition & 1 deletion app/2fa/server/functions/resetTOTP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Users } from '../../../models/server/raw/index';
import { IUser } from '../../../../definition/IUser';

const sendResetNotification = async function(uid: string): Promise<void> {
const user: IUser = await Users.findOneById(uid, { projection: { language: 1, emails: 1 } });
const user = await Users.findOneById<Pick<IUser, 'language' | 'emails'>>(uid, { projection: { language: 1, emails: 1 } });
if (!user) {
throw new Meteor.Error('invalid-user');
}
Expand Down
Loading

0 comments on commit 6ef35ed

Please sign in to comment.