removed oAuth endpoint from dispatch, started oAuth endpoints for moodle

This commit is contained in:
PxlLoewe
2025-02-25 23:23:18 +01:00
parent 4c35257cf0
commit b81bab1dc2
7 changed files with 137 additions and 182 deletions

View File

@@ -1,32 +1,39 @@
import { Authorize } from './_components/Authorize';
import { Authorize } from "./_components/Authorize";
export const services = [
{
id: '123456',
service: 'dispatch',
name: 'Leitstellendisposition',
approvedUrls: ['http://localhost:3001'],
},
{
id: '789456',
service: 'desktop',
name: 'Desktop client',
approvedUrls: ['var'],
},
{
id: "1",
service: "dispatch",
name: "Leitstellendisposition",
approvedUrls: ["http://localhost:3001"],
},
{
id: "2",
service: "desktop",
name: "Desktop client",
approvedUrls: ["var"],
},
{
id: "3",
secret: "d0f3e4e4",
service: "moodle",
name: "Moodle",
approvedUrls: ["https://moodle.virtualairrescue.com"],
},
];
export type Service = (typeof services)[number];
export default async ({
searchParams,
searchParams,
}: {
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
}) => {
const { service: serviceId } = await searchParams;
const service = services.find((service) => service.id === serviceId);
const { service: serviceId } = await searchParams;
const service = services.find((service) => service.id === serviceId);
if (!service) {
return <div>Service not found</div>;
}
if (!service) {
return <div>Service not found</div>;
}
return <Authorize service={service} />;
return <Authorize service={service} />;
};