Fix issues with new user save data

This commit is contained in:
2026-01-22 13:09:12 -07:00
parent 6caddea356
commit 2901d62a1a
2 changed files with 3 additions and 1 deletions

View File

@@ -52,6 +52,7 @@ export async function handler (context: Context) {
)
let savedata = JSON.parse(result[0].saveData)
if (!savedata.account) savedata.account = {}
savedata.account.id = userId
savedata.account.name = result2[0].username
savedata.account.session = result[0].token

View File

@@ -1,7 +1,7 @@
import { Context } from 'elysia'
import { getDatabaseConnection, jsonResponse } from '../../../../lib/util'
import { checkAuthorization } from '../../../../lib/bd/auth'
import { berryDashUserData, users } from '../../../../lib/tables'
import { berryDashUserData } from '../../../../lib/tables'
import { eq } from 'drizzle-orm'
type Body = {
@@ -42,6 +42,7 @@ export async function handler (context: Context) {
let userSaveData: any = {}
try {
userSaveData = JSON.parse(atob(body.saveData))
if (!userSaveData.account) userSaveData.account = {}
userSaveData.account.id = null
userSaveData.account.name = null
userSaveData.account.session = null