rhythia-api 144.0.0 → 145.0.0

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.
@@ -9,6 +9,7 @@ import {
9
9
  S3Client,
10
10
  } from "@aws-sdk/client-s3";
11
11
  import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
12
+ import { validateIntrinsicToken } from "../utils/validateToken";
12
13
 
13
14
  const s3Client = new S3Client({
14
15
  region: "auto",
@@ -9,6 +9,7 @@ import {
9
9
  S3Client,
10
10
  } from "@aws-sdk/client-s3";
11
11
  import { getSignedUrl } from "@aws-sdk/s3-request-presigner";
12
+ import { validateIntrinsicToken } from "../utils/validateToken";
12
13
 
13
14
  const s3Client = new S3Client({
14
15
  region: "auto",
@@ -66,6 +67,12 @@ export async function handler({
66
67
  });
67
68
  }
68
69
 
70
+ if (contentType !== "application/octet-stream") {
71
+ return NextResponse.json({
72
+ error: "Unnacceptable format",
73
+ });
74
+ }
75
+
69
76
  const key = `rhythia-${mapName ? mapName : user.id}-${Date.now()}.sspm`;
70
77
  const command = new PutObjectCommand({
71
78
  Bucket: "rhthia-avatars",
package/api/getProfile.ts CHANGED
@@ -8,7 +8,7 @@ import { supabase } from "../utils/supabase";
8
8
  export const Schema = {
9
9
  input: z.strictObject({
10
10
  session: z.string(),
11
- id: z.number().optional(),
11
+ id: z.number().nullable().optional(),
12
12
  }),
13
13
  output: z.object({
14
14
  error: z.string().optional(),
@@ -51,7 +51,7 @@ export async function handler(
51
51
  let profiles: Database["public"]["Tables"]["profiles"]["Row"][] = [];
52
52
 
53
53
  // Fetch by id
54
- if (data.id !== undefined) {
54
+ if (data.id !== undefined && data.id !== null) {
55
55
  let { data: queryData, error } = await supabase
56
56
  .from("profiles")
57
57
  .select("*")