Fixed type errors in nextJS apps, added Docker files
Co-authored-by: Nicolas <nocnico@users.noreply.github.com>
This commit is contained in:
@@ -1,48 +1,20 @@
|
||||
import { services } from "../../../helper/authServices";
|
||||
import { Authorize } from "./_components/Authorize";
|
||||
|
||||
export const services = [
|
||||
{
|
||||
id: "1",
|
||||
service: "dispatch",
|
||||
name: "Leitstellendisposition",
|
||||
approvedUrls: ["http://localhost:3001"],
|
||||
},
|
||||
{
|
||||
id: "2",
|
||||
secret: "jp2k430fnv",
|
||||
service: "desktop",
|
||||
name: "Desktop client",
|
||||
approvedUrls: ["var://oAuth"],
|
||||
},
|
||||
{
|
||||
id: "3",
|
||||
secret: "d0f3e4e4",
|
||||
service: "moodle",
|
||||
name: "Moodle",
|
||||
approvedUrls: [
|
||||
"http://localhost:8081",
|
||||
"https://moodle.virtualairrescue.com",
|
||||
],
|
||||
},
|
||||
];
|
||||
export type Service = (typeof services)[number];
|
||||
|
||||
const Page = async ({
|
||||
export default async function Page({
|
||||
searchParams,
|
||||
}: {
|
||||
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
|
||||
}) => {
|
||||
searchParams: Promise<{ client_id: string; service: string }>;
|
||||
}) {
|
||||
const { service: serviceId, client_id: clientId } = await searchParams;
|
||||
|
||||
const service = services.find(
|
||||
(service) => service.id === serviceId || service.id === clientId,
|
||||
);
|
||||
const service = services.find((service) => service.id === serviceId || service.id === clientId);
|
||||
|
||||
if (!service) {
|
||||
return <div>Service not found</div>;
|
||||
}
|
||||
|
||||
return <Authorize service={service} />;
|
||||
};
|
||||
|
||||
export default Page;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user