+
+function handleAuthInPlugin (req: express.Request, res: express.Response) {
+ const authOptions = res.locals.externalAuth
+
+ try {
+ logger.debug('Forwarding auth plugin request in %s of plugin %s.', authOptions.authName, res.locals.registeredPlugin.npmName)
+ authOptions.onAuthRequest(req, res)
+ } catch (err) {
+ logger.error('Forward request error in auth %s of plugin %s.', authOptions.authName, res.locals.registeredPlugin.npmName, { err })
+ }
+}