fixed to handle scope init option
This commit is contained in:
parent
b5758dadc4
commit
a522a7a1cc
|
@ -442,16 +442,14 @@
|
|||
baseUrl = kc.endpoints.authorize();
|
||||
}
|
||||
|
||||
var scope;
|
||||
if (options && options.scope || kc.scope) {
|
||||
if (options.scope.indexOf("openid") != -1) {
|
||||
scope = options.scope;
|
||||
} else {
|
||||
scope = "openid " + options.scope;
|
||||
}
|
||||
} else {
|
||||
scope = "openid";
|
||||
}
|
||||
var scope = options && options.scope || kc.scope;
|
||||
if (!scope) {
|
||||
// if scope is not set, default to "openid"
|
||||
scope = "openid";
|
||||
} else if (scope.indexOf("openid") === -1) {
|
||||
// if openid scope is missing, prefix the given scopes with it
|
||||
scope = "openid " + scope;
|
||||
}
|
||||
|
||||
var url = baseUrl
|
||||
+ '?client_id=' + encodeURIComponent(kc.clientId)
|
||||
|
|
Loading…
Reference in New Issue