wirejs-deploy-amplify-basic 0.0.100-realtime → 0.0.101-realtime

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.
@@ -23,7 +23,7 @@ type AuthorizationResult = {
23
23
  };
24
24
 
25
25
  let secret: Promise<string> | undefined = undefined;
26
- async function getSecret(ns: string): Promise<any> {
26
+ async function getSecret(ns: string): Promise<string> {
27
27
  if (!secret) {
28
28
  secret = new Promise(async (resolve, reject) => {
29
29
  try {
@@ -51,13 +51,14 @@ export const handler = async (event: AuthorizationRequest): Promise<Authorizatio
51
51
  * 4. Must be for the correct channel
52
52
  */
53
53
  try {
54
+ console.log('Authorization event:', JSON.stringify(event, null, 2));
54
55
  const token = event.authorizationToken;
55
56
  if (!token) {
56
57
  throw new Error('Authorization token is missing');
57
58
  }
58
59
  const decoded = await jose.jwtVerify(
59
60
  token,
60
- await getSecret(event.requestContext.channelNamespaceName)
61
+ new TextEncoder().encode(await getSecret(event.requestContext.channelNamespaceName))
61
62
  );
62
63
  if (decoded.payload.channel !== event.requestContext.channel) {
63
64
  throw new Error('Channel mismatch');
@@ -3,6 +3,6 @@
3
3
  "dependencies": {
4
4
  "jsdom": "^25.0.1",
5
5
  "wirejs-dom": "^1.0.41",
6
- "wirejs-resources": "^0.1.68-realtime"
6
+ "wirejs-resources": "^0.1.69-realtime"
7
7
  }
8
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wirejs-deploy-amplify-basic",
3
- "version": "0.0.100-realtime",
3
+ "version": "0.0.101-realtime",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -41,7 +41,7 @@
41
41
  "recursive-copy": "^2.0.14",
42
42
  "rimraf": "^6.0.1",
43
43
  "wirejs-dom": "^1.0.41",
44
- "wirejs-resources": "^0.1.68-realtime"
44
+ "wirejs-resources": "^0.1.69-realtime"
45
45
  },
46
46
  "devDependencies": {
47
47
  "@aws-amplify/backend": "^1.14.0",