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/stale@v3.0.18
- uses: actions/stale@v3.0.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/stale@v3.0.18
# - uses: actions/stale@v3.0.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 @@ check@1.3.1
ddp-rate-limiter@1.0.9
ddp-common@1.4.0
dynamic-import@0.6.0
ecmascript@0.15.0
typescript@4.1.2
ecmascript@0.15.1
typescript@4.2.2
ejson@1.1.1
email@2.0.0
fastclick@1.0.13
http@1.4.2
logging@1.2.0
meteor-base@1.4.0
mobile-experience@1.1.0
mongo@1.10.1
mongo@1.11.0
random@1.2.0
rate-limit@1.0.9
reactive-dict@1.3.0
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
underscore@1.0.10
littledata:synced-cron

edgee:slingshot
jalik:ufs-local@1.0.2
accounts-base@1.8.0
accounts-base@1.9.0
accounts-oauth@1.2.0
autoupdate@1.7.0
babel-compiler@7.6.0
babel-compiler@7.6.1
google-oauth@1.3.0
htmljs
less
Expand All @@ -82,7 +82,7 @@ oauth2@1.3.0
routepolicy@1.1.0
sha@1.0.9
templating
webapp@1.10.0
webapp@1.10.1
webapp-hashing@1.1.0
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
accounts-facebook@1.3.2
accounts-github@1.4.3
accounts-google@1.3.3
accounts-meteor-developer@1.4.2
accounts-oauth@1.2.0
accounts-password@1.7.0
accounts-password@1.7.1
accounts-twitter@1.4.2
aldeed:simple-schema@1.5.4
allow-deny@1.1.0
autoupdate@1.7.0
babel-compiler@7.6.0
babel-compiler@7.6.1
babel-runtime@1.5.0
base64@1.0.12
binary-heap@1.0.11
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
boilerplate-generator@1.7.1
caching-compiler@1.2.2
caching-html-compiler@1.1.3
caching-html-compiler@1.2.0
callback-hook@1.3.0
cfs:http-methods@0.0.32
check@1.3.1
coffeescript@1.0.17
dandv:caret-position@2.1.1
ddp@1.4.0
ddp-client@2.4.0
ddp-client@2.4.1
ddp-common@1.4.0
ddp-rate-limiter@1.0.9
ddp-server@2.3.2
ddp-server@2.3.3
deps@1.0.12
diff-sequence@1.1.1
dispatch:run-as-user@1.1.1
dynamic-import@0.6.0
ecmascript@0.15.0
ecmascript@0.15.1
ecmascript-runtime@0.7.0
ecmascript-runtime-client@0.11.0
ecmascript-runtime-server@0.10.0
ecmascript-runtime-client@0.11.1
ecmascript-runtime-server@0.10.1
edgee:slingshot@0.7.1
ejson@1.1.1
email@2.0.0
es5-shim@4.8.0
facebook-oauth@1.7.4
facebook-oauth@1.8.0
facts-base@1.0.1
fastclick@1.0.13
fetch@0.1.1
geojson-utils@1.0.10
github-oauth@1.2.3
google-oauth@1.3.0
hot-code-push@1.0.4
html-tools@1.0.11
htmljs@1.0.11
http@1.4.3
id-map@1.1.0
html-tools@1.1.2
htmljs@1.1.1
http@1.4.4
id-map@1.1.1
inter-process-messaging@0.1.1
jalik:ufs@1.0.2
jalik:ufs-gridfs@1.0.2
jalik:ufs-local@1.0.2
jparker:crypto-core@0.1.0
jparker:crypto-md5@0.1.1
jparker:gravatar@0.5.1
jquery@1.11.11
jquery@3.0.0
kadira:flow-router@2.12.1
konecty:multiple-instances-status@1.1.0
konecty:user-presence@2.6.3
launch-screen@1.2.0
launch-screen@1.2.1
less@3.0.1
littledata:synced-cron@1.5.1
livedata@1.0.18
Expand All @@ -75,27 +75,27 @@ mdg:validation-error@0.5.1
meteor@1.9.3
meteor-base@1.4.0
meteor-developer-oauth@1.2.3
meteorhacks:inject-initial@1.0.4
meteorhacks:inject-initial@1.0.5
meteorspark:util@0.2.0
minifier-css@1.5.3
minifier-css@1.5.4
minifier-js@2.6.0
minimongo@1.6.1
minimongo@1.6.2
mizzao:timesync@0.3.4
mobile-experience@1.1.0
mobile-status-bar@1.1.0
modern-browsers@0.1.5
modules@0.16.0
modules-runtime@0.12.0
mongo@1.10.1
mongo@1.11.1
mongo-decimal@0.1.2
mongo-dev-server@1.1.0
mongo-id@1.0.7
mongo-id@1.0.8
mrt:reactive-store@0.0.1
mystor:device-detection@0.2.0
nimble:restivus@0.8.12
nooitaf:colors@1.1.2_1
npm-bcrypt@0.9.3
npm-mongo@3.8.1
npm-bcrypt@0.9.4
npm-mongo@3.9.0
oauth@1.3.2
oauth1@1.3.0
oauth2@1.3.0
Expand All @@ -105,7 +105,7 @@ ostrio:cookies@2.7.0
pauli:accounts-linkedin@5.0.0
pauli:linkedin-oauth@5.0.0
promise@0.11.2
raix:eventemitter@0.1.3
raix:eventemitter@1.0.0
raix:handlebar-helpers@0.2.5
raix:ui-dropped-event@0.0.7
random@1.2.0
Expand All @@ -122,28 +122,28 @@ rocketchat:mongo-config@0.0.1
rocketchat:oauth2-server@2.1.0
rocketchat:postcss@1.0.0
rocketchat:streamer@1.1.0
rocketchat:tap-i18n@1.9.1
rocketchat:tap-i18n@1.10.1
rocketchat:version@1.0.0
routepolicy@1.1.0
service-configuration@1.0.11
session@1.2.0
sha@1.0.9
shell-server@0.5.0
simple:json-routes@2.1.0
socket-stream-client@0.3.1
spacebars@1.0.15
spacebars-compiler@1.1.3
socket-stream-client@0.3.3
spacebars@1.2.0
spacebars-compiler@1.2.1
srp@1.1.0
standard-minifier-js@2.6.0
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
tracker@1.2.0
twitter-oauth@1.2.0
typescript@4.1.2
typescript@4.2.2
ui@1.0.13
underscore@1.0.10
url@1.3.1
webapp@1.10.0
url@1.3.2
webapp@1.10.1
webapp-hashing@1.1.0
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.