@sneko/ionic-appauth
Version:
Intergration for OpenId/AppAuth-JS into Ionic V3/4/5
26 lines (25 loc) • 998 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.EndSessionRequest = void 0;
var crypto_utils_1 = require("@openid/appauth/built/crypto_utils");
var BYTES_LENGTH = 10;
var newState = function (crypto) {
return crypto.generateRandom(BYTES_LENGTH);
};
var EndSessionRequest = /** @class */ (function () {
function EndSessionRequest(request, crypto) {
if (crypto === void 0) { crypto = new crypto_utils_1.DefaultCrypto(); }
this.state = request.state || newState(crypto);
this.idTokenHint = request.idTokenHint;
this.postLogoutRedirectURI = request.postLogoutRedirectURI;
}
EndSessionRequest.prototype.toJson = function () {
var json = { idTokenHint: this.idTokenHint, postLogoutRedirectURI: this.postLogoutRedirectURI };
if (this.state) {
json['state'] = this.state;
}
return json;
};
return EndSessionRequest;
}());
exports.EndSessionRequest = EndSessionRequest;