Skip to content

Commit

Permalink
prevent loading page on reconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
ggazzo committed Oct 24, 2024
1 parent 72182ba commit 8e88055
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions apps/meteor/app/authentication/server/startup/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,12 @@ import { setAvatarFromServiceWithValidation } from '../../../lib/server/function
import { notifyOnSettingChangedById } from '../../../lib/server/lib/notifyListener';
import * as Mailer from '../../../mailer/server/api';
import { settings } from '../../../settings/server';
import { getBaseUserFields } from '../../../utils/server/functions/getBaseUserFields';
import { safeGetMeteorUser } from '../../../utils/server/functions/safeGetMeteorUser';
import { isValidAttemptByUser, isValidLoginAttemptByIp } from '../lib/restrictLoginAttempts';

Accounts.config({
defaultFieldSelector: { ...getBaseUserFields(), services: 1 },
forbidClientAccountCreation: true,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ export class CachedCollection<T extends { _id: string }, U = T> extends Emitter<
CachedCollectionManager.onLogin(() => {
void this.init();
});
Accounts.onLogout(() => {
this.ready.set(false);
});
}

protected get eventName(): `${Name}-changed` | `${string}/${Name}-changed` {
Expand Down Expand Up @@ -342,8 +345,6 @@ export class CachedCollection<T extends { _id: string }, U = T> extends Emitter<
}

async init() {
this.ready.set(false);

if (await this.loadFromCache()) {
this.trySync();
} else {
Expand Down

0 comments on commit 8e88055

Please sign in to comment.