aurelia-kis-oidc
Version:
An Aurelia plugin that encapsulates oidc-client-js library.
30 lines (28 loc) • 860 B
JavaScript
var _dec, _class;
import { inject } from 'aurelia-framework';
/**
* Implements the logic to find out the correct OpenID Connect flow.
* @category internal
*/
export var OpenidSilentLoginDetector = (_dec = 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);