Skip to content

Commit 6880fb3

Browse files
committed
Merge branch 'develop' into new/livechat-voip
2 parents 8bc0d8c + 45a5d1f commit 6880fb3

File tree

529 files changed

+13363
-13221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

529 files changed

+13363
-13221
lines changed

.meteor/versions

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ mystor:[email protected]
9494
9595
9696
97-
97+
9898
9999
100100

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ We are a MERN based application enabling real-time conversations between colleag
66

77
Every day, tens of millions of users in over 150 countries and in organizations such as Deutsche Bahn, The US Navy, and Credit Suisse trust [Rocket.Chat](https://rocket.chat) to keep their communications completely private and secure.
88

9-
* [Review product documentation](https://docs.rocket.chat/)
10-
* [Review developer documentation](https://developer.rocket.chat/)
9+
* [Review product documentation](https://docs.rocket.chat)
10+
* [Review developer documentation](https://developer.rocket.chat)
1111

1212
Using our self-managed offerings you can deploy Rocket.Chat on your own server, or you can use SaaS Rocket.Chat. We offer support for both community as well as commercial plans.
1313

@@ -21,7 +21,7 @@ https://cloud.rocket.chat/trial
2121

2222
## Installation
2323
Please see the [requirements documentation](https://docs.rocket.chat/installing-and-updating/minimum-requirements-for-using-rocket.chat) for system requirements and more information about supported operating systems.
24-
Please refer to [Install Rocket.Chat](https://rocket.chat/install/) to install your Rocket.Chat instance.
24+
Please refer to [Install Rocket.Chat](https://rocket.chat/install) to install your Rocket.Chat instance.
2525

2626

2727
## Feature Request
@@ -30,42 +30,43 @@ Please refer to [Install Rocket.Chat](https://rocket.chat/install/) to install y
3030

3131
## Community
3232

33-
Join thousands of members worldwide in our [community server](https://open.rocket.chat/).
33+
Join thousands of members worldwide in our [community server](https://open.rocket.chat).
3434
Join [#Support](https://open.rocket.chat/channel/support) for help from our community with general Rocket.Chat questions.
3535
Join [#Dev](https://open.rocket.chat/channel/dev) for needing help from the community to develop new features.
36+
Talk with Rocket.Chat's leadership at the [Community Open Call](https://www.youtube.com/watch?v=RdbqOdUb3Wk), held monthly. Join us for [the next Community Open Call](https://app.livestorm.co/rocket-chat/community-open-call?type=detailed).
3637

3738
## Contributions
3839

3940
Rocket.Chat is an open source project and we are very happy to accept community contributions. Please refer to the [How can I help?](https://docs.rocket.chat/contributors/how-can-i-help) for more details.
4041

4142
## Credits
4243

43-
* Emoji provided graciously by [JoyPixels](https://www.joypixels.com/)
44-
* Testing with [BrowserStack](https://www.browserstack.com/)
45-
* Translations done with [LingoHub](https://lingohub.com/)
44+
* Emoji provided graciously by [JoyPixels](https://www.joypixels.com).
45+
* Testing with [BrowserStack](https://www.browserstack.com).
46+
* Translations done with [LingoHub](https://lingohub.com).
4647

4748

4849
## Mobile Apps
4950

5051
In addition to the web interface, you can also download Rocket.Chat clients for:
5152

52-
[![Rocket.Chat on Apple App Store](https://user-images.githubusercontent.com/551004/29770691-a2082ff4-8bc6-11e7-89a6-964cd405ea8e.png)](https://itunes.apple.com/us/app/rocket-chat/id1148741252?mt=8) [![Rocket.Chat on Google Play](https://user-images.githubusercontent.com/551004/29770692-a20975c6-8bc6-11e7-8ab0-1cde275496e0.png)](https://play.google.com/store/apps/details?id=chat.rocket.android) [![](https://user-images.githubusercontent.com/551004/48210349-50649480-e35e-11e8-97d9-74a4331faf3a.png)](https://f-droid.org/en/packages/chat.rocket.android/)
53+
[![Rocket.Chat on Apple App Store](https://user-images.githubusercontent.com/551004/29770691-a2082ff4-8bc6-11e7-89a6-964cd405ea8e.png)](https://itunes.apple.com/us/app/rocket-chat/id1148741252?mt=8) [![Rocket.Chat on Google Play](https://user-images.githubusercontent.com/551004/29770692-a20975c6-8bc6-11e7-8ab0-1cde275496e0.png)](https://play.google.com/store/apps/details?id=chat.rocket.android) [![](https://user-images.githubusercontent.com/551004/48210349-50649480-e35e-11e8-97d9-74a4331faf3a.png)](https://f-droid.org/en/packages/chat.rocket.android)
5354

5455
## Learn More
55-
* [API](https://developer.rocket.chat/)
56-
* [See who's using Rocket.Chat](https://rocket.chat/customer-stories/)
56+
* [API](https://developer.rocket.chat)
57+
* [See who's using Rocket.Chat](https://rocket.chat/customer-stories)
5758

5859
## Become a Rocketeer
59-
We're hiring developers, support people, and product managers all the time. Please check our [jobs page](https://rocket.chat/jobs/).
60+
We're hiring developers, support people, and product managers all the time. Please check our [jobs page](https://rocket.chat/jobs).
6061

6162
## Get the Latest News
6263

6364
* [Twitter](https://twitter.com/RocketChat)
64-
* [Blog](https://rocket.chat/blog/)
65-
* [Facebook](https://www.facebook.com/RocketChatApp/)
66-
* [LinkedIn](https://www.linkedin.com/company/rocket-chat/)
65+
* [Blog](https://rocket.chat/blog)
66+
* [Facebook](https://www.facebook.com/RocketChatApp)
67+
* [LinkedIn](https://www.linkedin.com/company/rocket-chat)
6768
* [Youtube](https://www.youtube.com/channel/UCin9nv7mUjoqrRiwrzS5UVQ)
68-
* [Email Newsletter](https://rocket.chat/newsletter/)
69+
* [Email Newsletter](https://rocket.chat/newsletter)
6970

7071
Any other questions, reach out to us at [[email protected]]([email protected]). We’d happy to help!
7172

app/2fa/README.md

Whitespace-only changes.

app/2fa/client/TOTPCrowd.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Meteor } from 'meteor/meteor';
22
import { Accounts } from 'meteor/accounts-base';
33

4-
import { Utils2fa } from './lib/2fa';
54
import '../../crowd/client/index';
5+
import { reportError } from '../../../client/lib/2fa/utils';
6+
import { overrideLoginMethod } from '../../../client/lib/2fa/overrideLoginMethod';
67

78
Meteor.loginWithCrowdAndTOTP = function(username, password, code, callback) {
89
const loginRequest = {
@@ -20,7 +21,7 @@ Meteor.loginWithCrowdAndTOTP = function(username, password, code, callback) {
2021
}],
2122
userCallback(error) {
2223
if (error) {
23-
Utils2fa.reportError(error, callback);
24+
reportError(error, callback);
2425
} else {
2526
callback && callback();
2627
}
@@ -31,5 +32,5 @@ Meteor.loginWithCrowdAndTOTP = function(username, password, code, callback) {
3132
const { loginWithCrowd } = Meteor;
3233

3334
Meteor.loginWithCrowd = function(username, password, callback) {
34-
Utils2fa.overrideLoginMethod(loginWithCrowd, [username, password], callback, Meteor.loginWithCrowdAndTOTP);
35+
overrideLoginMethod(loginWithCrowd, [username, password], callback, Meteor.loginWithCrowdAndTOTP);
3536
};

app/2fa/client/TOTPGoogle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Accounts } from 'meteor/accounts-base';
33
import { Google } from 'meteor/google-oauth';
44
import _ from 'underscore';
55

6-
import { Utils2fa } from './lib/2fa';
6+
import { overrideLoginMethod } from '../../../client/lib/2fa/overrideLoginMethod';
77

88
const loginWithGoogleAndTOTP = function(options, code, callback) {
99
// support a callback without options
@@ -37,5 +37,5 @@ const loginWithGoogleAndTOTP = function(options, code, callback) {
3737

3838
const { loginWithGoogle } = Meteor;
3939
Meteor.loginWithGoogle = function(options, cb) {
40-
Utils2fa.overrideLoginMethod(loginWithGoogle, [options], cb, loginWithGoogleAndTOTP);
40+
overrideLoginMethod(loginWithGoogle, [options], cb, loginWithGoogleAndTOTP);
4141
};

app/2fa/client/TOTPLDAP.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Meteor } from 'meteor/meteor';
22
import { Accounts } from 'meteor/accounts-base';
33

4-
import { Utils2fa } from './lib/2fa';
54
import '../../../client/startup/ldap';
5+
import { reportError } from '../../../client/lib/2fa/utils';
6+
import { overrideLoginMethod } from '../../../client/lib/2fa/overrideLoginMethod';
67

78
Meteor.loginWithLDAPAndTOTP = function(...args) {
89
// Pull username and password
@@ -34,7 +35,7 @@ Meteor.loginWithLDAPAndTOTP = function(...args) {
3435
}],
3536
userCallback(error) {
3637
if (error) {
37-
Utils2fa.reportError(error, callback);
38+
reportError(error, callback);
3839
} else {
3940
callback && callback();
4041
}
@@ -47,5 +48,5 @@ const { loginWithLDAP } = Meteor;
4748
Meteor.loginWithLDAP = function(...args) {
4849
const callback = typeof args[args.length - 1] === 'function' ? args.pop() : null;
4950

50-
Utils2fa.overrideLoginMethod(loginWithLDAP, args, callback, Meteor.loginWithLDAPAndTOTP, args[0]);
51+
overrideLoginMethod(loginWithLDAP, args, callback, Meteor.loginWithLDAPAndTOTP, args[0]);
5152
};

app/2fa/client/TOTPOAuth.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ import { MeteorDeveloperAccounts } from 'meteor/meteor-developer-oauth';
88
import { Linkedin } from 'meteor/pauli:linkedin-oauth';
99
import { OAuth } from 'meteor/oauth';
1010

11-
import { Utils2fa } from './lib/2fa';
12-
import { process2faReturn } from './callWithTwoFactorRequired';
11+
import { process2faReturn } from '../../../client/lib/2fa/process2faReturn';
1312
import { CustomOAuth } from '../../custom-oauth';
13+
import { convertError } from '../../../client/lib/2fa/utils';
14+
import { overrideLoginMethod } from '../../../client/lib/2fa/overrideLoginMethod';
1415

1516
let lastCredentialToken = null;
1617
let lastCredentialSecret = null;
@@ -36,7 +37,7 @@ Accounts.oauth.tryLoginAfterPopupClosed = function(credentialToken, callback, to
3637
Accounts.callLoginMethod({
3738
methodArguments: [methodArgument],
3839
userCallback: callback && function(err) {
39-
callback(Utils2fa.convertError(err));
40+
callback(convertError(err));
4041
} });
4142
};
4243

@@ -74,31 +75,31 @@ const loginWithOAuthTokenAndTOTP = createOAuthTotpLoginMethod();
7475
const loginWithFacebookAndTOTP = createOAuthTotpLoginMethod(() => Facebook);
7576
const { loginWithFacebook } = Meteor;
7677
Meteor.loginWithFacebook = function(options, cb) {
77-
Utils2fa.overrideLoginMethod(loginWithFacebook, [options], cb, loginWithFacebookAndTOTP);
78+
overrideLoginMethod(loginWithFacebook, [options], cb, loginWithFacebookAndTOTP);
7879
};
7980

8081
const loginWithGithubAndTOTP = createOAuthTotpLoginMethod(() => Github);
8182
const { loginWithGithub } = Meteor;
8283
Meteor.loginWithGithub = function(options, cb) {
83-
Utils2fa.overrideLoginMethod(loginWithGithub, [options], cb, loginWithGithubAndTOTP);
84+
overrideLoginMethod(loginWithGithub, [options], cb, loginWithGithubAndTOTP);
8485
};
8586

8687
const loginWithMeteorDeveloperAccountAndTOTP = createOAuthTotpLoginMethod(() => MeteorDeveloperAccounts);
8788
const { loginWithMeteorDeveloperAccount } = Meteor;
8889
Meteor.loginWithMeteorDeveloperAccount = function(options, cb) {
89-
Utils2fa.overrideLoginMethod(loginWithMeteorDeveloperAccount, [options], cb, loginWithMeteorDeveloperAccountAndTOTP);
90+
overrideLoginMethod(loginWithMeteorDeveloperAccount, [options], cb, loginWithMeteorDeveloperAccountAndTOTP);
9091
};
9192

9293
const loginWithTwitterAndTOTP = createOAuthTotpLoginMethod(() => Twitter);
9394
const { loginWithTwitter } = Meteor;
9495
Meteor.loginWithTwitter = function(options, cb) {
95-
Utils2fa.overrideLoginMethod(loginWithTwitter, [options], cb, loginWithTwitterAndTOTP);
96+
overrideLoginMethod(loginWithTwitter, [options], cb, loginWithTwitterAndTOTP);
9697
};
9798

9899
const loginWithLinkedinAndTOTP = createOAuthTotpLoginMethod(() => Linkedin);
99100
const { loginWithLinkedin } = Meteor;
100101
Meteor.loginWithLinkedin = function(options, cb) {
101-
Utils2fa.overrideLoginMethod(loginWithLinkedin, [options], cb, loginWithLinkedinAndTOTP);
102+
overrideLoginMethod(loginWithLinkedin, [options], cb, loginWithLinkedinAndTOTP);
102103
};
103104

104105
Accounts.onPageLoadLogin((loginAttempt) => {
@@ -133,6 +134,6 @@ CustomOAuth.prototype.configureLogin = function(...args) {
133134
const oldMethod = Meteor[loginWithService];
134135

135136
Meteor[loginWithService] = function(options, cb) {
136-
Utils2fa.overrideLoginMethod(oldMethod, [options], cb, loginWithOAuthTokenAndTOTP);
137+
overrideLoginMethod(oldMethod, [options], cb, loginWithOAuthTokenAndTOTP);
137138
};
138139
};

app/2fa/client/TOTPPassword.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { Meteor } from 'meteor/meteor';
22
import { Accounts } from 'meteor/accounts-base';
3-
import toastr from 'toastr';
43

5-
import { Utils2fa } from './lib/2fa';
64
import { t } from '../../utils';
7-
import { process2faReturn } from './callWithTwoFactorRequired';
5+
import { process2faReturn } from '../../../client/lib/2fa/process2faReturn';
6+
import { isTotpInvalidError, reportError } from '../../../client/lib/2fa/utils';
7+
import { dispatchToastMessage } from '../../../client/lib/toast';
88

99
Meteor.loginWithPasswordAndTOTP = function(selector, password, code, callback) {
1010
if (typeof selector === 'string') {
@@ -27,7 +27,7 @@ Meteor.loginWithPasswordAndTOTP = function(selector, password, code, callback) {
2727
}],
2828
userCallback(error) {
2929
if (error) {
30-
Utils2fa.reportError(error, callback);
30+
reportError(error, callback);
3131
} else {
3232
callback && callback();
3333
}
@@ -45,12 +45,16 @@ Meteor.loginWithPassword = function(email, password, cb) {
4545
emailOrUsername: email,
4646
onCode: (code) => {
4747
Meteor.loginWithPasswordAndTOTP(email, password, code, (error) => {
48-
if (error && error.error === 'totp-invalid') {
49-
toastr.error(t('Invalid_two_factor_code'));
48+
if (isTotpInvalidError(error)) {
49+
dispatchToastMessage({
50+
type: 'error',
51+
message: t('Invalid_two_factor_code'),
52+
});
5053
cb();
51-
} else {
52-
cb(error);
54+
return;
5355
}
56+
57+
cb(error);
5458
});
5559
},
5660
});

app/2fa/client/TOTPSaml.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import { Meteor } from 'meteor/meteor';
22
import { Accounts } from 'meteor/accounts-base';
33

4-
import { Utils2fa } from './lib/2fa';
54
import '../../meteor-accounts-saml/client/saml_client';
5+
import { reportError } from '../../../client/lib/2fa/utils';
6+
import { overrideLoginMethod } from '../../../client/lib/2fa/overrideLoginMethod';
67

78
Meteor.loginWithSamlTokenAndTOTP = function(credentialToken, code, callback) {
89
Accounts.callLoginMethod({
@@ -17,7 +18,7 @@ Meteor.loginWithSamlTokenAndTOTP = function(credentialToken, code, callback) {
1718
}],
1819
userCallback(error) {
1920
if (error) {
20-
Utils2fa.reportError(error, callback);
21+
reportError(error, callback);
2122
} else {
2223
callback && callback();
2324
}
@@ -28,5 +29,5 @@ Meteor.loginWithSamlTokenAndTOTP = function(credentialToken, code, callback) {
2829
const { loginWithSamlToken } = Meteor;
2930

3031
Meteor.loginWithSamlToken = function(options, callback) {
31-
Utils2fa.overrideLoginMethod(loginWithSamlToken, [options], callback, Meteor.loginWithSamlTokenAndTOTP);
32+
overrideLoginMethod(loginWithSamlToken, [options], callback, Meteor.loginWithSamlTokenAndTOTP);
3233
};

app/2fa/client/callWithTwoFactorRequired.js

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)