wikijs-fork/server/controllers/auth.js
2018-12-02 21:42:43 -05:00

32 lines
546 B
JavaScript

/* global WIKI */
const express = require('express')
const router = express.Router()
/**
* Login form
*/
router.get('/login', function (req, res, next) {
res.render('login')
})
/**
* Logout
*/
router.get('/logout', function (req, res) {
req.logout()
res.redirect('/')
})
/**
* JWT Public Endpoints
*/
router.get('/.well-known/jwk.json', function (req, res, next) {
res.json(WIKI.config.certs.jwk)
})
router.get('/.well-known/jwk.pem', function (req, res, next) {
res.send(WIKI.config.certs.public)
})
module.exports = router