2024-08-19 20:06:38 +02:00
|
|
|
import { apiRoute, applyConfig } from "@/api";
|
2024-05-29 02:59:49 +02:00
|
|
|
import { config } from "~/packages/config-manager";
|
2024-04-18 10:42:12 +02:00
|
|
|
|
|
|
|
|
export const meta = applyConfig({
|
|
|
|
|
allowedMethods: ["GET"],
|
|
|
|
|
auth: {
|
|
|
|
|
required: false,
|
|
|
|
|
},
|
|
|
|
|
ratelimits: {
|
|
|
|
|
duration: 30,
|
|
|
|
|
max: 60,
|
|
|
|
|
},
|
|
|
|
|
route: "/.well-known/openid-configuration",
|
|
|
|
|
});
|
|
|
|
|
|
2024-08-19 20:06:38 +02:00
|
|
|
export default apiRoute((app) =>
|
2024-08-19 21:03:59 +02:00
|
|
|
app.on(meta.allowedMethods, meta.route, (context) => {
|
2024-06-13 04:26:43 +02:00
|
|
|
const baseUrl = new URL(config.http.base_url);
|
2024-08-19 21:03:59 +02:00
|
|
|
return context.json({
|
2024-06-13 04:26:43 +02:00
|
|
|
issuer: baseUrl.origin.toString(),
|
|
|
|
|
authorization_endpoint: `${baseUrl.origin}/oauth/authorize`,
|
|
|
|
|
token_endpoint: `${baseUrl.origin}/oauth/token`,
|
|
|
|
|
userinfo_endpoint: `${baseUrl.origin}/api/v1/accounts/verify_credentials`,
|
|
|
|
|
jwks_uri: `${baseUrl.origin}/.well-known/jwks`,
|
2024-05-06 09:16:33 +02:00
|
|
|
response_types_supported: ["code"],
|
|
|
|
|
subject_types_supported: ["public"],
|
|
|
|
|
id_token_signing_alg_values_supported: ["EdDSA"],
|
|
|
|
|
scopes_supported: ["openid", "profile", "email"],
|
|
|
|
|
token_endpoint_auth_methods_supported: ["client_secret_basic"],
|
|
|
|
|
claims_supported: ["sub"],
|
|
|
|
|
});
|
2024-08-19 20:06:38 +02:00
|
|
|
}),
|
|
|
|
|
);
|