mirror of
https://github.com/wassname/talk.git
synced 2026-06-30 09:58:52 +08:00
27 lines
829 B
JavaScript
27 lines
829 B
JavaScript
const express = require('express');
|
|
const router = express.Router();
|
|
|
|
// 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('password-reset', {redirectUri: process.env.TALK_ROOT_URL});
|
|
});
|
|
|
|
router.get('/login', (req, res, next) => {
|
|
res.render('admin/login');
|
|
});
|
|
|
|
router.get('*', (req, res) => {
|
|
res.render('admin', {basePath: '/client/coral-admin'});
|
|
});
|
|
|
|
module.exports = router;
|