@goscribe/server 1.1.5 → 1.1.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goscribe/server",
3
- "version": "1.1.5",
3
+ "version": "1.1.6",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -47,7 +47,7 @@ export const auth = router({
47
47
  const objectKey = `profile_picture_${ctx.session.user.id}`;
48
48
  const { data: signedUrlData, error: signedUrlError } = await supabaseClient.storage
49
49
  .from('media')
50
- .createSignedUploadUrl(objectKey); // 5 minutes
50
+ .createSignedUploadUrl(objectKey, { upsert: true }); // 5 minutes
51
51
  if (signedUrlError) {
52
52
  throw new TRPCError({ code: 'INTERNAL_SERVER_ERROR', message: `Failed to generate upload URL: ${signedUrlError.message}` });
53
53
  }
@@ -161,7 +161,16 @@ export const auth = router({
161
161
  };
162
162
  }),
163
163
  logout: publicProcedure.mutation(async ({ ctx }) => {
164
- // Clear the auth cookie
164
+ const token = ctx.cookies["auth_token"];
165
+
166
+ if (!token) {
167
+ throw new Error("No token found");
168
+ }
169
+
170
+ await ctx.db.session.delete({
171
+ where: { id: token },
172
+ });
173
+
165
174
  ctx.res.setHeader("Set-Cookie", serialize("auth_token", "", {
166
175
  httpOnly: true,
167
176
  secure: process.env.NODE_ENV === "production",
@@ -191,7 +191,7 @@ export const workspace = router({
191
191
  folders: folders.length,
192
192
  lastUpdated: lastUpdated?.updatedAt,
193
193
  spaceUsed: spaceLeft._sum?.size ?? 0,
194
- spaceLeft: 1000000000 - (spaceLeft._sum?.size ?? 0) || 0,
194
+ spaceTotal: 1000000000,
195
195
  };
196
196
  }),
197
197
  update: authedProcedure