UNPKG

whodis-sdk

Version:

A simple sdk for easy, secure authentication with the whodis platform. Setup secure authentication for your app in seconds.

23 lines 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.reportAuthErrorForDiagnosis = void 0; /** * securely reports an auth error to whodis * * for the purpose of: * - automatically detecting security attacks and mitigating * - aiding in debugging, with proactive and reactive support * * messages encrypted in flight and at rest destination */ const reportAuthErrorForDiagnosis = async ({ error, headers, config, log, }) => { // log warn for all rejections. even refreshes, since their client should not be sending requests with expired tokens - it should know better log.warn('authentication error detected', { error: { name: error.name, message: error.message }, context: { config, headers }, }); // send the message to whodis to help with proactive reach out, reactive support, and for automated security monitoring // TODO: actually report it back to whodis }; exports.reportAuthErrorForDiagnosis = reportAuthErrorForDiagnosis; //# sourceMappingURL=reportAuthErrorForDiagnosis.js.map