mirror of https://github.com/requarks/wiki
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
546 B
32 lines
546 B
/* 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
|