wikijs-fork/server/controllers/auth.js

32 lines
546 B
JavaScript
Raw Normal View History

/* global WIKI */
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) {
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