mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 04:37:04 +08:00
24 lines
726 B
JavaScript
24 lines
726 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
const {data} = require('../static');
|
|
|
|
// Get /email-confirmation expects a signed JWT in the hash
|
|
router.get('/confirm-email', (req, res) => {
|
|
res.render('admin/confirm-email');
|
|
});
|
|
|
|
// Get /password-reset expects a signed token (JWT) in the hash.
|
|
// Links to this endpoint are generated by /views/password-reset-email.ejs.
|
|
router.get('/password-reset', (req, res) => {
|
|
|
|
// TODO: store the redirect uri in the token or something fancy.
|
|
// admins and regular users should probably be redirected to different places.
|
|
res.render('admin/password-reset');
|
|
});
|
|
|
|
router.get('*', (req, res) => {
|
|
res.render('admin', {data});
|
|
});
|
|
|
|
module.exports = router;
|