auth fix?
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { setUserMetadata, superTokensFunctionMiddleware, getSessionContext } from "@/utils/supertokens";
|
||||
import { createServerFn } from "@tanstack/react-start";
|
||||
import { isRedirect } from "@tanstack/react-router";
|
||||
import { Player, playerInputSchema, playerUpdateSchema, PlayerStats } from "@/features/players/types";
|
||||
import { Match } from "@/features/matches/types";
|
||||
import { pbAdmin } from "@/lib/pocketbase/client";
|
||||
@@ -26,13 +27,8 @@ export const fetchMe = createServerFn()
|
||||
phone: context.phone
|
||||
};
|
||||
} catch (error: any) {
|
||||
// logger.info("FetchMe: Session error", error)
|
||||
if (error?.response?.status === 401) {
|
||||
const errorData = error?.response?.data;
|
||||
if (errorData?.error === "SESSION_REFRESH_REQUIRED") {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
if (isRedirect(error) || error instanceof Response) throw error;
|
||||
|
||||
return { user: undefined, roles: [], metadata: {}, phone: undefined };
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user