@mvx/identity
Version:
identity is oidc for mvc, type-mvc is base on koa. Decorator, Ioc, AOP mvc framework on server.
44 lines (42 loc) • 1.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.RedirectResult = void 0;
var tslib_1 = require("tslib");
var ValidationResult_1 = require("./ValidationResult");
/**
* Redirect to `url` with optional `status`, defaulting to 302.
*
* Strategies should return this function to redirect the user (via their
* user agent) to a third-party website for authentication.
*
* @param {String} url
* @param {Number} status
* @api public
*/
var RedirectResult = /** @class */ (function (_super) {
tslib_1.__extends(RedirectResult, _super);
function RedirectResult(url, status) {
if (status === void 0) { status = 302; }
var _this = _super.call(this) || this;
_this.url = url;
_this.status = status;
return _this;
}
/**
* execute.
*
* @param {Context} ctx
* @returns {Promise<void>}
* @memberof RedirectResult
*/
RedirectResult.prototype.action = function (ctx) {
ctx.status = this.status;
ctx.redirect(this.url);
};
RedirectResult.ρAnn = function () {
return { "name": "RedirectResult" };
};
return RedirectResult;
}(ValidationResult_1.ValidationResult));
exports.RedirectResult = RedirectResult;
//# sourceMappingURL=../../sourcemaps/passports/results/RedirectResult.js.map