fixes office365 undefined replacing BASE_URL -> NEXT_PUBLIC_BASE_URL

fix/base-url-undefined-office365
Agusti Fernandez Pardo 2022-03-03 23:18:44 +01:00
parent e23f9330d3
commit 20e56e3f9b
4 changed files with 6 additions and 6 deletions

@ -1 +1 @@
Subproject commit 378cbf8f3a67ea7877296f1da02edb2b6e3efbce
Subproject commit 63e0ca33e95583a5e2aae69195af052fd0d9aef8

View File

@ -2,7 +2,7 @@ import type { NextApiRequest, NextApiResponse } from "next";
import { stringify } from "querystring";
import { getSession } from "@lib/auth";
import { BASE_URL } from "@lib/config/constants";
import { NEXT_PUBLIC_BASE_URL } from "@lib/config/constants";
import { encodeOAuthState } from "../utils";
@ -23,7 +23,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
response_type: "code",
scope: scopes.join(" "),
client_id: process.env.MS_GRAPH_CLIENT_ID,
redirect_uri: BASE_URL + "/api/integrations/office365calendar/callback",
redirect_uri: NEXT_PUBLIC_BASE_URL + "/api/integrations/office365calendar/callback",
state,
};
const query = stringify(params);

View File

@ -1,7 +1,7 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { getSession } from "@lib/auth";
import { BASE_URL } from "@lib/config/constants";
import { NEXT_PUBLIC_BASE_URL } from "@lib/config/constants";
import prisma from "../../../../lib/prisma";
import { decodeOAuthState } from "../utils";
@ -32,7 +32,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
grant_type: "authorization_code",
code,
scope: scopes.join(" "),
redirect_uri: BASE_URL + "/api/integrations/office365calendar/callback",
redirect_uri: NEXT_PUBLIC_BASE_URL + "/api/integrations/office365calendar/callback",
client_secret: process.env.MS_GRAPH_CLIENT_SECRET!,
});

@ -1 +1 @@
Subproject commit aac908d6405603d2ef0554e5c43a55d4b7eb025c
Subproject commit f94a9e492c21864fee9fb9fa9112d547f95d985c