lib/middleware.js
/**
 * Responds with a login page. Also sets a 401 status (Unauthorized) and sends
 * a WWW-Authenticate header according to spec
 *
 * @param {HTTP Request object} req
 * @param {HTTP Response object} res
 */
Responds with a login page. Also sets a 401 status (Unauthorized) and sends
a WWW-Authenticate header according to spec

@param {HTTP Request object} req
@param {HTTP Response object} res
Responds with a login page . Also sets a 401 status ( Unauthorized ) and sends a WWW - Authenticate header according to spec @param { HTTP Request object } req @param { HTTP Response object } res
function sendLoginPage(req, res) {
	res.status(NOT_AUTHORIZED)
	res.setHeader('WWW-Authenticate', `OAuth realm="${ getUrl(req) }"`)
	res.send(page('Not logged in', '<a href="/api/auth" class="button">Log in with Twitter</a>'))
}
function sendLoginPage ( req , res ) { res . status ( NOT_AUTHORIZED ) res . setHeader ( 'WWW-Authenticate' , ` ${ getUrl ( req ) } ` ) res . send ( page ( 'Not logged in' , '<a href="/api/auth" class="button">Log in with Twitter</a>' ) ) }
Responds with a login page.
Responds with a login page .