@unchainedshop/ticketing 5.0.0-alpha.1 → 5.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -25,7 +25,7 @@ const appleWalletHandler = async (req, res) => {
25
25
  return;
26
26
  }
27
27
  const { hash } = req.query;
28
- const correctHash = await modules.warehousing.buildAccessKeyForToken(tokenId);
28
+ const correctHash = await modules.warehousing.buildAccessKeyFromToken(token);
29
29
  if (!hash || hash !== correctHash) {
30
30
  res.status(403).send('Token hash invalid for current owner');
31
31
  return;
@@ -8,7 +8,7 @@ const isAuthenticationTokenCorrect = (req, authenticationToken) => {
8
8
  const appleWalletHandler = async (req, reply) => {
9
9
  const resolvedContext = req.unchainedContext;
10
10
  const { modules } = resolvedContext;
11
- const path = req.url;
11
+ const path = '/' + (req.params['*'] || '').split('?')[0];
12
12
  logger.info(`${path} (${JSON.stringify(req.query)})`);
13
13
  if (path.startsWith('/download/')) {
14
14
  try {
@@ -27,7 +27,7 @@ const appleWalletHandler = async (req, reply) => {
27
27
  return reply.send();
28
28
  }
29
29
  const { hash } = req.query;
30
- const correctHash = await modules.warehousing.buildAccessKeyForToken(tokenId);
30
+ const correctHash = await modules.warehousing.buildAccessKeyFromToken(token);
31
31
  if (!hash || hash !== correctHash) {
32
32
  logger.error('Token hash invalid for current owner', { tokenId });
33
33
  reply.status(403);
@@ -19,7 +19,7 @@ export const googleWalletHandler = async (req, res) => {
19
19
  res.status(404).send('Token not found');
20
20
  return;
21
21
  }
22
- const correctHash = await modules.warehousing.buildAccessKeyForToken(tokenId);
22
+ const correctHash = await modules.warehousing.buildAccessKeyFromToken(token);
23
23
  if (!hash || hash !== correctHash) {
24
24
  res.status(403).send('Token hash invalid for current owner');
25
25
  return;
@@ -21,7 +21,7 @@ const googleWalletHandler = async (req, reply) => {
21
21
  reply.status(404);
22
22
  return reply.send('Token not found');
23
23
  }
24
- const correctHash = await modules.warehousing.buildAccessKeyForToken(tokenId);
24
+ const correctHash = await modules.warehousing.buildAccessKeyFromToken(token);
25
25
  if (!hash || hash !== correctHash) {
26
26
  logger.error('Token hash invalid for current owner', { tokenId });
27
27
  reply.status(403);
package/lib/module.js CHANGED
@@ -9,9 +9,6 @@ const logger = createLogger('unchained:apple-wallet-webservice');
9
9
  const configurePasses = async ({ db }) => {
10
10
  const MediaObjects = await MediaObjectsCollection(db);
11
11
  const TokenSurrogates = await TokenSurrogateCollection(db);
12
- await buildDbIndexes(TokenSurrogates, [
13
- { index: { 'meta.cancelled': 1 }, options: { sparse: true } },
14
- ]);
15
12
  await buildDbIndexes(MediaObjects, [
16
13
  { index: { path: 1, 'meta.passTypeIdentifier': 1, 'meta.serialNumber': 1 } },
17
14
  {
package/lib/routes.js CHANGED
@@ -54,7 +54,7 @@ export async function googleWalletHandler(request, context) {
54
54
  }
55
55
  const url = new URL(request.url);
56
56
  const hash = url.searchParams.get('hash');
57
- const correctHash = await modules.warehousing.buildAccessKeyForToken(tokenId);
57
+ const correctHash = await modules.warehousing.buildAccessKeyFromToken(token);
58
58
  if (!hash || hash !== correctHash) {
59
59
  return new Response(JSON.stringify({ error: 'Token hash invalid for current owner' }), {
60
60
  status: 403,
@@ -96,7 +96,7 @@ export async function appleWalletHandler(request, context) {
96
96
  });
97
97
  }
98
98
  const hash = url.searchParams.get('hash');
99
- const correctHash = await modules.warehousing.buildAccessKeyForToken(tokenId);
99
+ const correctHash = await modules.warehousing.buildAccessKeyFromToken(token);
100
100
  if (!hash || hash !== correctHash) {
101
101
  return new Response(JSON.stringify({ error: 'Token hash invalid for current owner' }), {
102
102
  status: 403,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@unchainedshop/ticketing",
3
3
  "description": "Event ticketing extension for the Unchained Engine with PDF and wallet pass support",
4
- "version": "5.0.0-alpha.1",
4
+ "version": "5.0.0-alpha.2",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "type": "module",
@@ -44,7 +44,7 @@
44
44
  "@unchainedshop/mongodb": "^5.0.0-alpha.1"
45
45
  },
46
46
  "peerDependencies": {
47
- "@parse/node-apn": "^7.0.1",
47
+ "@parse/node-apn": "^8.1.0",
48
48
  "express": "5.x",
49
49
  "fastify": ">= 5.2 < 6"
50
50
  },
@@ -60,6 +60,7 @@
60
60
  }
61
61
  },
62
62
  "devDependencies": {
63
+ "@parse/node-apn": "^8.1.0",
63
64
  "@types/express": "^5.0.3",
64
65
  "@types/node": "^25.0.0",
65
66
  "express": "^5.1.0",