webfinger endpoint

This commit is contained in:
Satr14 2025-12-01 08:29:54 +07:00 committed by GitHub
commit 9ca72682b6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,24 @@
import type { RequestHandler } from './$types';
export const GET: RequestHandler = ({ url }) => {
const resource = url.searchParams.get('resource');
const issuer = "https://auth.satr14.my.id";
return new Response(
JSON.stringify({
subject: resource,
links: [
{
rel: 'http://openid.net/specs/connect/1.0/issuer',
href: issuer
}
]
}),
{
headers: {
'Content-Type': 'application/jrd+json',
'Access-Control-Allow-Origin': '*'
}
}
);
};