import express from 'express';
import { OidcService } from './oidcService';

const router = express.Router();

const oidcCallback = OidcService.callback();

// /.well-known/openid-configuration
router.get('/.well-known/openid-configuration', oidcCallback);

// /oauth/* — all OIDC endpoints
router.get('/oauth/authorize', oidcCallback);
router.post('/oauth/authorize', oidcCallback);
router.post('/oauth/token', oidcCallback);
router.get('/oauth/userinfo', oidcCallback);
router.get('/oauth/jwks', oidcCallback);
router.post('/oauth/introspect', oidcCallback);
router.post('/oauth/revoke', oidcCallback);
router.get('/oauth/logout', oidcCallback);
router.post('/oauth/logout', oidcCallback);

export default router;
