aurelia-kis-oidc
Version:
An Aurelia plugin that encapsulates oidc-client-js library.
33 lines (31 loc) • 1.01 kB
JavaScript
;
exports.__esModule = true;
exports.OpenidSilentLoginDetector = void 0;
var _aureliaFramework = require("aurelia-framework");
var _dec, _class;
/**
* Implements the logic to find out the correct OpenID Connect flow.
* @category internal
*/
var OpenidSilentLoginDetector = exports.OpenidSilentLoginDetector = (_dec = (0, _aureliaFramework.inject)(Window), _dec(_class = /*#__PURE__*/function () {
/**
* Creates an instance of the class with the given parameter.
* @param {Window} browserWindow - the navigator windows object
*/
function OpenidSilentLoginDetector(browserWindow) {
this._window = browserWindow;
}
/**
* Is the requested login a silent login?
* @return {boolean}
*/
var _proto = OpenidSilentLoginDetector.prototype;
_proto.isSilentLogin = function isSilentLogin() {
try {
return this._window.self !== this._window.top;
} catch (error) {
return true;
}
};
return OpenidSilentLoginDetector;
}()) || _class);