better debug handling
This commit is contained in:
parent
bb7fa017ef
commit
a952ee6197
|
@ -7,7 +7,7 @@ function create(myOpts) {
|
||||||
// TODO pre-generate URL
|
// TODO pre-generate URL
|
||||||
|
|
||||||
// deliver existing session if it exists
|
// deliver existing session if it exists
|
||||||
var scope = opts && (opts.scope || opts.claims || []);
|
var scope = opts && (opts.scope || opts.claims || myOpts.scope || myOpts.claims || []);
|
||||||
if (myOpts.session) {
|
if (myOpts.session) {
|
||||||
if (!scope.length || scope.every(function (scp) {
|
if (!scope.length || scope.every(function (scp) {
|
||||||
return -1 !== opts.myOpts.session.scope.indexOf(scp);
|
return -1 !== opts.myOpts.session.scope.indexOf(scp);
|
||||||
|
@ -23,6 +23,7 @@ function create(myOpts) {
|
||||||
// maybe use inline instead?
|
// maybe use inline instead?
|
||||||
, windowType: 'popup'
|
, windowType: 'popup'
|
||||||
, scope: scope
|
, scope: scope
|
||||||
|
, debug: opts.debug || myOpts.debug
|
||||||
}).then(function (session) {
|
}).then(function (session) {
|
||||||
return session;
|
return session;
|
||||||
});
|
});
|
||||||
|
@ -74,6 +75,8 @@ window.navigator.auth = {
|
||||||
var myOpts = {
|
var myOpts = {
|
||||||
directives: directives
|
directives: directives
|
||||||
, conf: conf
|
, conf: conf
|
||||||
|
, debug: opts.debug
|
||||||
|
, scope: scope
|
||||||
};
|
};
|
||||||
|
|
||||||
return OAUTH3.implicitGrant(directives, {
|
return OAUTH3.implicitGrant(directives, {
|
||||||
|
|
|
@ -836,6 +836,9 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
if (opts.debug) {
|
if (opts.debug) {
|
||||||
|
console.log('[DEBUG] [implicit_grant] url object:');
|
||||||
|
console.log(directives.issuer);
|
||||||
|
console.log(authReq);
|
||||||
window.alert("DEBUG MODE: Pausing so you can look at logs and whatnot :) Fire at will!");
|
window.alert("DEBUG MODE: Pausing so you can look at logs and whatnot :) Fire at will!");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue