@seas-computing/nestjs-harvard-key
Version:
This repository provides a way to connect NestJS applications to HarvardKey and provide a rudimentary form of authorization (in the form of route guards) out of the box
17 lines • 564 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RedirectCacheMiddleware = void 0;
const RedirectCacheMiddleware = (req, _, next) => {
if (req.query.redirectTo
&& typeof req.query.redirectTo === 'string'
&& req.query.redirectTo.startsWith('/')) {
req.session.loginOrigin = decodeURI(req.query.redirectTo);
}
else {
req.session.loginOrigin = '/';
}
;
next();
};
exports.RedirectCacheMiddleware = RedirectCacheMiddleware;
//# sourceMappingURL=RedirectCache.middleware.js.map