fix session expiring on hotreload, wait for pocketbase client to fully initialize on auth
This commit is contained in:
@@ -10,6 +10,7 @@ export const fetchMe = createServerFn().handler(async () => {
|
||||
if (!data || !data.userAuthId) return { user: undefined, roles: [], metadata: {} };
|
||||
|
||||
try {
|
||||
await pbAdmin.authPromise;
|
||||
const result = await pbAdmin.getPlayerByAuthId(data.userAuthId);
|
||||
logger.info('Fetched player', result);
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user