2018-03-05 20:49:36 +00:00
|
|
|
/* global WIKI */
|
2017-05-13 19:29:00 +00:00
|
|
|
|
2017-02-09 01:52:37 +00:00
|
|
|
const express = require('express')
|
|
|
|
const router = express.Router()
|
2016-08-17 03:56:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Login form
|
|
|
|
*/
|
2017-02-09 01:52:37 +00:00
|
|
|
router.get('/login', function (req, res, next) {
|
2018-08-11 22:16:56 +00:00
|
|
|
res.render('login')
|
2017-02-09 01:52:37 +00:00
|
|
|
})
|
2016-08-17 03:56:08 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Logout
|
|
|
|
*/
|
2017-02-09 01:52:37 +00:00
|
|
|
router.get('/logout', function (req, res) {
|
|
|
|
req.logout()
|
|
|
|
res.redirect('/')
|
|
|
|
})
|
2016-08-17 03:56:08 +00:00
|
|
|
|
2018-12-03 02:42:43 +00:00
|
|
|
/**
|
|
|
|
* 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)
|
|
|
|
})
|
|
|
|
|
2017-02-09 01:52:37 +00:00
|
|
|
module.exports = router
|