mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 15:48:32 -06:00
added build steps
This commit is contained in:
@@ -6,6 +6,7 @@ import { getQueryClient } from "./providersQueryClientUtils";
|
||||
import { hydrateCourses } from "@/hooks/hookHydration";
|
||||
import { dehydrate, HydrationBoundary } from "@tanstack/react-query";
|
||||
import { MyToaster } from "./MyToaster";
|
||||
import { cookies } from "next/headers";
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: "Canvas Manager 2.0",
|
||||
@@ -19,6 +20,7 @@ export default async function RootLayout({
|
||||
const queryClient = getQueryClient();
|
||||
await hydrateCourses(queryClient);
|
||||
const dehydratedState = dehydrate(queryClient);
|
||||
cookies() // disables static page generation at build time
|
||||
|
||||
return (
|
||||
<html lang="en">
|
||||
|
||||
@@ -17,14 +17,16 @@ if (!isServer) {
|
||||
} else {
|
||||
const token = process.env.CANVAS_TOKEN;
|
||||
if (!token) {
|
||||
throw new Error("CANVAS_TOKEN not in environment");
|
||||
console.error("CANVAS_TOKEN not in environment")
|
||||
// throw new Error("CANVAS_TOKEN not in environment");
|
||||
} else {
|
||||
axiosClient.interceptors.request.use((config) => {
|
||||
if (config.url && config.url.startsWith(canvasBaseUrl)) {
|
||||
config.headers.set("Authorization", `Bearer ${token}`);
|
||||
}
|
||||
return config;
|
||||
});
|
||||
}
|
||||
axiosClient.interceptors.request.use((config) => {
|
||||
if (config.url && config.url.startsWith(canvasBaseUrl)) {
|
||||
config.headers.set("Authorization", `Bearer ${token}`);
|
||||
}
|
||||
return config;
|
||||
});
|
||||
}
|
||||
|
||||
axiosClient.interceptors.response.use(
|
||||
|
||||
Reference in New Issue
Block a user