Skip to main content

Function: createAuthRequestHandler()

function createAuthRequestHandler(config): AuthRequestHandler

Bridges Robo.js requests to Auth.js so plugin routes can reuse the official handler.

Parameters​

ParameterTypeDescription
configAuthConfigFully prepared Auth.js configuration used to initialize the handler.

Returns​

AuthRequestHandler

An async function accepting Robo.js request/response objects and returning the Auth.js response.

Examples​

const handler = createAuthRequestHandler(authConfig)
const response = await handler(roboRequest)
export default createAuthRequestHandler(buildAuthConfig({ adapter }))