Finished Moodle oAuth service

READ Moodle section in README file
This commit is contained in:
PxlLoewe
2025-02-27 00:32:44 +01:00
parent b81bab1dc2
commit 9366f8f6b4
8 changed files with 149 additions and 50 deletions

View File

@@ -18,7 +18,10 @@ export const services = [
secret: "d0f3e4e4",
service: "moodle",
name: "Moodle",
approvedUrls: ["https://moodle.virtualairrescue.com"],
approvedUrls: [
"http://localhost:8081",
"https://moodle.virtualairrescue.com",
],
},
];
export type Service = (typeof services)[number];
@@ -28,8 +31,11 @@ export default async ({
}: {
searchParams: Promise<{ [key: string]: string | string[] | undefined }>;
}) => {
const { service: serviceId } = await searchParams;
const service = services.find((service) => service.id === serviceId);
const { service: serviceId, client_id: clientId } = await searchParams;
const service = services.find(
(service) => service.id === serviceId || service.id === clientId,
);
if (!service) {
return <div>Service not found</div>;