Throw an exception if init()
is called more than once (#20722)
Closes #12745
This commit is contained in:
parent
a31352aa18
commit
22fe316b3f
1 changed files with 6 additions and 0 deletions
|
@ -49,6 +49,12 @@ function Keycloak (config) {
|
||||||
var logWarn = createLogger(console.warn);
|
var logWarn = createLogger(console.warn);
|
||||||
|
|
||||||
kc.init = function (initOptions) {
|
kc.init = function (initOptions) {
|
||||||
|
if (kc.didInitialize) {
|
||||||
|
throw new Error("A 'Keycloak' instance can only be initialized once.");
|
||||||
|
}
|
||||||
|
|
||||||
|
kc.didInitialize = true;
|
||||||
|
|
||||||
kc.authenticated = false;
|
kc.authenticated = false;
|
||||||
|
|
||||||
callbackStorage = createCallbackStorage();
|
callbackStorage = createCallbackStorage();
|
||||||
|
|
Loading…
Reference in a new issue