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