merge fetch and fetcher

This commit is contained in:
2025-08-09 10:46:11 +02:00
parent b20e0c3980
commit 4c70a3f72d
3 changed files with 12 additions and 15 deletions
+12 -1
View File
@@ -1,7 +1,18 @@
"use client";
import { Fetcher } from "openapi-typescript-fetch";
import { getUser } from "./fetch";
import { paths, components } from "muzak/data/types";
import { oidcConfig } from "muzak/config/auth";
import { User } from "oidc-client-ts";
export function getUser() {
let oidcStorage = window?.sessionStorage.getItem(
`oidc.user:${oidcConfig.authority}:${oidcConfig.client_id}`,
);
if (!oidcStorage) {
return null;
}
return User.fromStorageString(oidcStorage);
}
const fetcher = Fetcher.for<paths>();
const BASE_URL = process.env.NEXT_PUBLIC_BACKEND_HOST!;