Redirect a request to the login page provided by the Identityprovider-App.
import { redirectToLoginPage, UnauthorizedError } from "@dvelop-sdk/express-utils";app.use((err, req, res, next) => { if (err instanceof UnauthorizedError && req.accepts("text/html")) { redirectToLoginPage(req, res); } else { res.status(401).send("Unauthorized") // For Content-Types such as JSON return a 401 - Unauthorized }}); Copy
import { redirectToLoginPage, UnauthorizedError } from "@dvelop-sdk/express-utils";app.use((err, req, res, next) => { if (err instanceof UnauthorizedError && req.accepts("text/html")) { redirectToLoginPage(req, res); } else { res.status(401).send("Unauthorized") // For Content-Types such as JSON return a 401 - Unauthorized }});
Redirect a request to the login page provided by the Identityprovider-App.