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/app/authorization/client/hasPermission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Meteor } from 'meteor/meteor';

import { hasRole } from './hasRole';
import { PermissionsCachedStore } from '../../../client/cachedStores';
import { watch } from '../../../client/lib/cachedStores';
import { watch } from '../../../client/meteor/watch';
import { Permissions, Users } from '../../../client/stores';
import { AuthorizationUtils } from '../lib/AuthorizationUtils';

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/app/authorization/client/hasRole.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { IUser, IRole, IRoom } from '@rocket.chat/core-typings';

import { watch } from '../../../client/lib/cachedStores';
import { watch } from '../../../client/meteor/watch';
import { Roles, Subscriptions, Users } from '../../../client/stores';

export const hasRole = (userId: IUser['_id'], roleId: IRole['_id'], scope?: IRoom['_id']): boolean => {
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/lib/cachedStores/CachedStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import { baseURI } from '../baseURI';
import { onLoggedIn } from '../loggedIn';
import { CachedStoresManager } from './CachedStoresManager';
import type { IDocumentMapStore } from './DocumentMapStore';
import { watch } from './watch';
import { sdk } from '../../../app/utils/client/lib/SDKClient';
import { isTruthy } from '../../../lib/isTruthy';
import { withDebouncing } from '../../../lib/utils/highOrderFunctions';
import { watch } from '../../meteor/watch';
import { getConfig } from '../utils/getConfig';

type Name = 'rooms' | 'subscriptions' | 'permissions' | 'public-settings' | 'private-settings';
Expand Down
1 change: 0 additions & 1 deletion apps/meteor/client/lib/cachedStores/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ export { pipe } from './pipe';
export { applyQueryOptions } from './utils';
export { createDocumentMapStore, type IDocumentMapStore } from './DocumentMapStore';
export { MinimongoCollection } from './MinimongoCollection';
export { watch } from './watch';
export { PublicCachedStore, PrivateCachedStore } from './CachedStore';
export { createGlobalStore } from './createGlobalStore';
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 '../../meteorOverrides/login/oauth';
import { createOAuthTotpLoginMethod } from '../../meteor/overrides/login/oauth';
import { overrideLoginMethod, type LoginCallback } from '../2fa/overrideLoginMethod';
import { loginServices } from '../loginServices';
import { CustomOAuthError } from './CustomOAuthError';
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/lib/settings/settings.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { SettingValue } from '@rocket.chat/core-typings';

import { watch } from '../../meteor/watch';
import { PublicSettings } from '../../stores';
import { watch } from '../cachedStores';

type SettingCallback = (key: string, value: SettingValue) => void;

Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import './startup/accounts';
import './startup/fakeUserPresence';

import('@rocket.chat/fuselage-polyfills')
.then(() => import('./meteorOverrides'))
.then(() => import('./meteor/overrides'))
.then(() => import('./ecdh'))
.then(() => import('./importPackages'))
.then(() => import('./startup'))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { DDPCommon } from 'meteor/ddp-common';
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';

import { sdk } from '../../app/utils/client/lib/SDKClient';
import { sdk } from '../../../app/utils/client/lib/SDKClient';

const bypassMethods: string[] = ['setUserStatus', 'logout'];

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 @@ -5,8 +5,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 @@ -5,8 +5,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 @@ -5,8 +5,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
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 @@ -3,8 +3,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 @@ -5,8 +5,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,6 +1,6 @@
import { Meteor } from 'meteor/meteor';

import { PublicSettings } from '../stores';
import { PublicSettings } from '../../stores';

PublicSettings.use.subscribe((state) => {
const removedIds = new Set(Object.keys(Meteor.settings)).difference(new Set(state.records.keys()));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Meteor } from 'meteor/meteor';

import { t } from '../../app/utils/lib/i18n';
import type { LoginCallback } from '../lib/2fa/overrideLoginMethod';
import { process2faReturn, process2faAsyncReturn } from '../lib/2fa/process2faReturn';
import { isTotpInvalidError } from '../lib/2fa/utils';
import { t } from '../../../app/utils/lib/i18n';
import type { LoginCallback } from '../../lib/2fa/overrideLoginMethod';
import { process2faReturn, process2faAsyncReturn } from '../../lib/2fa/process2faReturn';
import { isTotpInvalidError } from '../../lib/2fa/utils';

const withSyncTOTP = (call: (name: string, ...args: any[]) => any) => {
const callWithTotp =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Accounts } from 'meteor/accounts-base';

import { CachedStoresManager } from '../lib/cachedStores';
import { CachedStoresManager } from '../../lib/cachedStores';

const { _unstoreLoginToken } = Accounts;
Accounts._unstoreLoginToken = (...args) => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IUser } from '@rocket.chat/core-typings';
import { Tracker } from 'meteor/tracker';

import { Users } from '../stores/Users';
import { Users } from '../../stores/Users';

// assertion is needed because global Mongo.Collection differs from the `meteor/mongo` package's Mongo.Collection
Meteor.users = Users.collection as typeof Meteor.users;
Expand Down
2 changes: 1 addition & 1 deletion apps/meteor/client/startup/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { Tracker } from 'meteor/tracker';
import { sdk } from '../../app/utils/client/lib/SDKClient';
import { t } from '../../app/utils/lib/i18n';
import { PublicSettingsCachedStore, SubscriptionsCachedStore } from '../cachedStores';
import { watch } from '../lib/cachedStores';
import { dispatchToastMessage } from '../lib/toast';
import { useUserDataSyncReady } from '../lib/userData';
import { watch } from '../meteor/watch';

const watchMainReady = () => {
const uid = Meteor.userId();
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9419,7 +9419,7 @@ __metadata:
peerDependencies:
"@rocket.chat/layout": "*"
"@rocket.chat/tools": 0.2.3
"@rocket.chat/ui-contexts": 22.0.0-rc.6
"@rocket.chat/ui-contexts": 22.0.0
"@tanstack/react-query": "*"
react: "*"
react-hook-form: "*"
Expand Down
Loading