@indiekit/endpoint-auth
Version:
IndieAuth authentication and authorization endpoint for Indiekit. Grants and verifies access tokens and authenticates users.
15 lines (14 loc) • 396 B
JavaScript
/**
* Service documentation
* @type {import("express").ErrorRequestHandler}
*/
export const documentationController = (error, request, response, next) => {
if (request.accepts("html")) {
response.render("auth", {
title: response.locals.__("auth.guidance.title"),
...(error.message && { error }),
});
} else if (request.accepts("json")) {
return next(error);
}
};