Add webhook notification functionality with configuration options
This commit is contained in:
@@ -10,6 +10,7 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
try {
|
||||
const EVE_SSO_CALLBACK_URL = process.env.EVE_SSO_CALLBACK_URL;
|
||||
const EVE_SSO_CLIENT_ID = process.env.EVE_SSO_CLIENT_ID;
|
||||
const WEBHOOK_ENABLED = !!process.env.WEBHOOK_URL;
|
||||
|
||||
if (!EVE_SSO_CALLBACK_URL || !EVE_SSO_CLIENT_ID) {
|
||||
logger.error({
|
||||
@@ -27,11 +28,16 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
|
||||
event: 'env_request_success',
|
||||
vars: {
|
||||
hasCallbackUrl: true,
|
||||
hasClientId: true
|
||||
hasClientId: true,
|
||||
webhookEnabled: WEBHOOK_ENABLED
|
||||
}
|
||||
});
|
||||
|
||||
return res.json({ EVE_SSO_CLIENT_ID, EVE_SSO_CALLBACK_URL });
|
||||
return res.json({
|
||||
EVE_SSO_CLIENT_ID,
|
||||
EVE_SSO_CALLBACK_URL,
|
||||
WEBHOOK_ENABLED
|
||||
});
|
||||
} catch (e) {
|
||||
logger.error({
|
||||
event: 'env_request_failed',
|
||||
|
Reference in New Issue
Block a user