Skip to content

Commit

Permalink
fix: simplify meteor collection auth checks
Browse files Browse the repository at this point in the history
This removes some deprecation warnings
See meteor/meteor#13444
  • Loading branch information
Julusian committed Feb 5, 2025
1 parent 55ffea8 commit 3d66275
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 21 deletions.
10 changes: 5 additions & 5 deletions meteor/.meteor/packages
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

# but you can also edit it by hand.

meteor@2.0.1
[email protected].3
meteor@2.1.0
[email protected].4
[email protected]

mongo@2.0.2 # The database Meteor supports right now
mongo@2.1.0 # The database Meteor supports right now

[email protected].9 # Enable ECMAScript2015+ syntax in app code
typescript@5.4.3 # Enable TypeScript syntax in .ts and .tsx modules
[email protected].10 # Enable ECMAScript2015+ syntax in app code
typescript@5.6.3 # Enable TypeScript syntax in .ts and .tsx modules

[email protected] # Meteor's client-side reactive programming library

Expand Down
2 changes: 1 addition & 1 deletion meteor/.meteor/release
Original file line number Diff line number Diff line change
@@ -1 +1 @@
[email protected]
[email protected].1
16 changes: 8 additions & 8 deletions meteor/.meteor/versions
12 changes: 5 additions & 7 deletions meteor/server/collections/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,11 @@ function setupCollectionAllowRules<DBInterface extends { _id: ProtectedString<an

const { /* insert: origInsert,*/ update: origUpdate /*remove: origRemove*/ } = args

// These methods behave weirdly, we need to mangle this a bit.
// See https://github.com/meteor/meteor/issues/13444 for a full explanation
const options: any /*Parameters<Mongo.Collection<DBInterface>['allow']>[0]*/ = {
update: () => false,
updateAsync: origUpdate
? (userId: string | null, doc: DBInterface, fieldNames: string[], modifier: any) =>
origUpdate(protectString(userId), doc, fieldNames as any, modifier) as any
const options: Parameters<Mongo.Collection<DBInterface>['allow']>[0] = {
update: origUpdate
? async (userId: string | null, doc: DBInterface, fieldNames: string[], modifier: any) => {
return origUpdate(protectString(userId), doc, fieldNames as any, modifier)
}
: () => false,
}

Expand Down
1 change: 1 addition & 0 deletions packages/webui/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default defineConfig({
},

server: {
allowedHosts: true,
proxy: {
'/api': 'http://127.0.0.1:3000',
'/site.webmanifest': 'http://127.0.0.1:3000',
Expand Down

0 comments on commit 3d66275

Please sign in to comment.