the last few things.
This commit is contained in:
+9
-5
@@ -17,12 +17,16 @@ router.get("/login", saveReferer, passport.authenticate("auth0", {scope: "openid
|
||||
res.redirect("/")
|
||||
})
|
||||
|
||||
router.get("/callback", passport.authenticate("auth0"), (req, res) => {
|
||||
if (req.user == null) {
|
||||
throw new Error("user null");
|
||||
}
|
||||
router.get("/callback", function (req, res, next) {
|
||||
passport.authenticate("auth0", function (err, user, info) {
|
||||
if (err) { return next(err) }
|
||||
if (!user) { console.log(err, user, info); return res.redirect("/auth/login") }
|
||||
req.logIn(user, function (err) {
|
||||
if (err) { return next(err) }
|
||||
|
||||
res.redirect(req.session.loginReferrer || "/");
|
||||
res.redirect(req.session.loginReferrer || "/");
|
||||
})
|
||||
})(req, res, next);
|
||||
})
|
||||
|
||||
router.get("/user", (req, res) => {
|
||||
|
||||
@@ -6,8 +6,10 @@ const {changesApi} = require("../../rpdata/api/Change")
|
||||
const changesTemplate = require("../../marko/page/data/changes.marko")
|
||||
|
||||
router.get("/", async(req, res) => {
|
||||
const limit = parseInt(req.query.limit) || 100
|
||||
|
||||
res.markoAsync(changesTemplate, {
|
||||
changes: changesApi.list({limit: 1000}),
|
||||
changes: changesApi.list({limit}),
|
||||
selected: {changes: true},
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user