Fix mysql incompatibility

This commit is contained in:
KernelDeimos 2024-04-12 00:10:56 -04:00
parent 0eedcf567e
commit 356a3284fa

View File

@ -240,7 +240,10 @@ class AuthService extends BaseService {
[uuid],
);
session.meta = JSON.parse(session.meta ?? {});
session.meta = this.db.case({
mysql: () => session.meta,
otherwise: () => JSON.parse(session.meta ?? "{}")
})();
return session;
}
@ -375,10 +378,13 @@ class AuthService extends BaseService {
);
sessions.forEach(session => {
session.meta = this.db.case({
mysql: () => session.meta,
otherwise: () => JSON.parse(session.meta ?? "{}")
})();
if ( session.uuid === actor.type.session ) {
session.current = true;
}
session.meta = JSON.parse(session.meta ?? "{}");
});
return sessions;