Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/meteor/client/lib/customOAuth/CustomOAuth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { OAuth } from 'meteor/oauth';

import { isURL } from '../../../lib/utils/isURL';
import type { IOAuthProvider } from '../../definitions/IOAuthProvider';
import { createOAuthTotpLoginMethod } from '../../meteor/overrides/login/oauth';
import { createOAuthTotpLoginMethod } from '../../meteor/login/oauth';
import { overrideLoginMethod, type LoginCallback } from '../2fa/overrideLoginMethod';
import { loginServices } from '../loginServices';
import { CustomOAuthError } from './CustomOAuthError';
Expand Down
6 changes: 3 additions & 3 deletions apps/meteor/client/main.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import './meteor/overrides';
import './meteor/startup';
import './serviceWorker';
import './startup/accounts';
import './startup/desktopInjection';

import('@rocket.chat/fuselage-polyfills')
.then(() => import('./meteor/overrides'))
.then(() => import('./meteor/login'))
.then(() => import('./ecdh'))
.then(() => import('./importPackages'))
.then(() => import('./startup'))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Random } from '@rocket.chat/random';
import { Meteor } from 'meteor/meteor';

import { callLoginMethod } from '../../../lib/2fa/overrideLoginMethod';
import { callLoginMethod } from '../../lib/2fa/overrideLoginMethod';

declare module 'meteor/meteor' {
// eslint-disable-next-line @typescript-eslint/no-namespace
Expand All @@ -12,7 +12,7 @@ declare module 'meteor/meteor' {

Meteor.loginWithCas = (_, callback) => {
const credentialToken = Random.id();
import('../../../lib/openCASLoginPopup')
import('../../lib/openCASLoginPopup')
.then(({ openCASLoginPopup }) => openCASLoginPopup(credentialToken))
.then(() => callLoginMethod({ methodArguments: [{ cas: { credentialToken } }] }))
.then(() => callback?.())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';

import { callLoginMethod, handleLogin, type LoginCallback } from '../../../lib/2fa/overrideLoginMethod';
import { callLoginMethod, handleLogin, type LoginCallback } from '../../lib/2fa/overrideLoginMethod';

declare module 'meteor/meteor' {
// eslint-disable-next-line @typescript-eslint/no-namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Meteor } from 'meteor/meteor';
import { OAuth } from 'meteor/oauth';

import { createOAuthTotpLoginMethod } from './oauth';
import { overrideLoginMethod } from '../../../lib/2fa/overrideLoginMethod';
import { wrapRequestCredentialFn } from '../../../lib/wrapRequestCredentialFn';
import { overrideLoginMethod } from '../../lib/2fa/overrideLoginMethod';
import { wrapRequestCredentialFn } from '../../lib/wrapRequestCredentialFn';

const { loginWithFacebook } = Meteor;
const loginWithFacebookAndTOTP = createOAuthTotpLoginMethod(Facebook);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Meteor } from 'meteor/meteor';
import { OAuth } from 'meteor/oauth';

import { createOAuthTotpLoginMethod } from './oauth';
import { overrideLoginMethod } from '../../../lib/2fa/overrideLoginMethod';
import { wrapRequestCredentialFn } from '../../../lib/wrapRequestCredentialFn';
import { overrideLoginMethod } from '../../lib/2fa/overrideLoginMethod';
import { wrapRequestCredentialFn } from '../../lib/wrapRequestCredentialFn';

const { loginWithGithub } = Meteor;
const loginWithGithubAndTOTP = createOAuthTotpLoginMethod(Github);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { Meteor } from 'meteor/meteor';
import { OAuth } from 'meteor/oauth';

import { createOAuthTotpLoginMethod } from './oauth';
import { overrideLoginMethod, type LoginCallback } from '../../../lib/2fa/overrideLoginMethod';
import { wrapRequestCredentialFn } from '../../../lib/wrapRequestCredentialFn';
import { overrideLoginMethod, type LoginCallback } from '../../lib/2fa/overrideLoginMethod';
import { wrapRequestCredentialFn } from '../../lib/wrapRequestCredentialFn';

declare module 'meteor/meteor' {
// eslint-disable-next-line @typescript-eslint/no-namespace
Expand Down
11 changes: 11 additions & 0 deletions apps/meteor/client/meteor/login/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import './cas';
import './crowd';
import './facebook';
import './github';
import './google';
import './ldap';
import './meteorDeveloperAccount';
import './oauth';
import './password';
import './saml';
import './twitter';
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Meteor } from 'meteor/meteor';

import { callLoginMethod, handleLogin, type LoginCallback } from '../../../lib/2fa/overrideLoginMethod';
import { callLoginMethod, handleLogin, type LoginCallback } from '../../lib/2fa/overrideLoginMethod';

declare module 'meteor/meteor' {
// eslint-disable-next-line @typescript-eslint/no-namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { MeteorDeveloperAccounts } from 'meteor/meteor-developer-oauth';
import { OAuth } from 'meteor/oauth';

import { createOAuthTotpLoginMethod } from './oauth';
import { overrideLoginMethod } from '../../../lib/2fa/overrideLoginMethod';
import { wrapRequestCredentialFn } from '../../../lib/wrapRequestCredentialFn';
import { overrideLoginMethod } from '../../lib/2fa/overrideLoginMethod';
import { wrapRequestCredentialFn } from '../../lib/wrapRequestCredentialFn';

const { loginWithMeteorDeveloperAccount } = Meteor;
const loginWithMeteorDeveloperAccountAndTOTP = createOAuthTotpLoginMethod(MeteorDeveloperAccounts);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Accounts } from 'meteor/accounts-base';
import { Meteor } from 'meteor/meteor';
import { OAuth } from 'meteor/oauth';

import type { IOAuthProvider } from '../../../definitions/IOAuthProvider';
import type { LoginCallback } from '../../../lib/2fa/overrideLoginMethod';
import type { IOAuthProvider } from '../../definitions/IOAuthProvider';
import type { LoginCallback } from '../../lib/2fa/overrideLoginMethod';

const isLoginCancelledError = (error: unknown): error is Meteor.Error =>
error instanceof Meteor.Error && error.error === Accounts.LoginCancelledError.numericError;
Expand Down Expand Up @@ -113,7 +113,7 @@ Accounts.onPageLoadLogin(async (loginAttempt: any) => {
const { credentialToken, credentialSecret } = oAuthArgs.oauth;
const cb = loginAttempt.userCallback;

const { process2faReturn } = await import('../../../lib/2fa/process2faReturn');
const { process2faReturn } = await import('../../lib/2fa/process2faReturn');

await process2faReturn({
error: loginAttempt.error,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Accounts } from 'meteor/accounts-base';
import { Meteor } from 'meteor/meteor';

import { overrideLoginMethod, type LoginCallback } from '../../../lib/2fa/overrideLoginMethod';
import { overrideLoginMethod, type LoginCallback } from '../../lib/2fa/overrideLoginMethod';

declare module 'meteor/meteor' {
// eslint-disable-next-line @typescript-eslint/no-namespace
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import { Random } from '@rocket.chat/random';
import { Accounts } from 'meteor/accounts-base';
import { Meteor } from 'meteor/meteor';

import { type LoginCallback, callLoginMethod, handleLogin } from '../../../lib/2fa/overrideLoginMethod';
import { settings } from '../../../lib/settings';
import { type LoginCallback, callLoginMethod, handleLogin } from '../../lib/2fa/overrideLoginMethod';
import { settings } from '../../lib/settings';

declare module 'meteor/meteor' {
// eslint-disable-next-line @typescript-eslint/no-namespace
Expand Down Expand Up @@ -61,7 +61,7 @@ Meteor.logout = async function (...args) {
if (provider && settings.peek('SAML_Custom_Default_idp_slo_redirect_url')) {
console.info('SAML session terminated via SLO');

const { sdk } = await import('../../../../app/utils/client/lib/SDKClient');
const { sdk } = await import('../../../app/utils/client/lib/SDKClient');
sdk
.call('samlLogout', provider)
.then((result) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { OAuth } from 'meteor/oauth';
import { Twitter } from 'meteor/twitter-oauth';

import { createOAuthTotpLoginMethod } from './oauth';
import { overrideLoginMethod } from '../../../lib/2fa/overrideLoginMethod';
import { wrapRequestCredentialFn } from '../../../lib/wrapRequestCredentialFn';
import { overrideLoginMethod } from '../../lib/2fa/overrideLoginMethod';
import { wrapRequestCredentialFn } from '../../lib/wrapRequestCredentialFn';

const { loginWithTwitter } = Meteor;
const loginWithTwitterAndTOTP = createOAuthTotpLoginMethod(Twitter);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { watch } from '../meteor/watch';
import { PublicSettings } from '../stores';
import { PublicSettings } from '../../stores';
import { watch } from '../watch';

if (window.RocketChatDesktop) {
// backport of rocketchat:user-presence for the desktop app
Expand Down
16 changes: 3 additions & 13 deletions apps/meteor/client/meteor/overrides/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
import './ddpOverREST';
import './totpOnCall';
import './desktopInjection';
import './oauthRedirectUri';
import './settings';
import './totpOnCall';
import './unstoreLoginToken';
import './userAndUsers';
import './login/cas';
import './login/crowd';
import './login/facebook';
import './login/github';
import './login/google';
import './login/ldap';
import './login/meteorDeveloperAccount';
import './login/oauth';
import './login/password';
import './login/saml';
import './login/twitter';
import './settings';
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meteor } from 'meteor/meteor';

import { baseURI } from '../lib/baseURI';
import { baseURI } from '../../lib/baseURI';

Meteor.absoluteUrl.defaultOptions.rootUrl = baseURI;
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { Accounts } from 'meteor/accounts-base';
import { Meteor } from 'meteor/meteor';

import { sdk } from '../../app/utils/client/lib/SDKClient';
import { t } from '../../app/utils/lib/i18n';
import { PublicSettingsCachedStore, SubscriptionsCachedStore } from '../cachedStores';
import { dispatchToastMessage } from '../lib/toast';
import { userIdStore } from '../lib/user';
import { useUserDataSyncReady } from '../lib/userData';
import { sdk } from '../../../app/utils/client/lib/SDKClient';
import { t } from '../../../app/utils/lib/i18n';
import { PublicSettingsCachedStore, SubscriptionsCachedStore } from '../../cachedStores';
import { dispatchToastMessage } from '../../lib/toast';
import { userIdStore } from '../../lib/user';
import { useUserDataSyncReady } from '../../lib/userData';

const whenMainReady = (): Promise<void> => {
const isMainReady = (): boolean => {
Expand Down
2 changes: 2 additions & 0 deletions apps/meteor/client/meteor/startup/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import './absoluteUrl';
import './accounts';
1 change: 0 additions & 1 deletion apps/meteor/client/startup/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import '../lib/rooms/roomTypes';
import './absoluteUrl';
import './appRoot';
import './audit';
import './callbacks';
Expand Down
Loading