server: Fixed redirect loop on auth internal failure.
the build was successful

This commit is contained in:
2018-10-15 20:07:21 +02:00
parent dd3c8642cb
commit 346bd7f70c
2 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@gisle/rpdata-frontend",
"version": "1.0.1",
"version": "1.0.2",
"description": "RPData (www.aiterp.net) frontend/proxy",
"main": "./index.js",
"scripts": {
+5 -1
View File
@@ -17,7 +17,11 @@ router.get("/login", saveReferer, passport.authenticate("auth0", {scope: "openid
res.redirect("/")
})
router.get("/callback", passport.authenticate("auth0", { failureRedirect: "/auth/login" }), (req, res) => {
router.get("/error", (req, res) => {
res.render("Login error")
})
router.get("/callback", passport.authenticate("auth0", { failureRedirect: "/auth/error" }), (req, res) => {
if (req.user == null) {
throw new Error("user null");
}