better debug handling

This commit is contained in:
AJ ONeal 2017-12-08 06:53:01 +00:00
parent bb7fa017ef
commit a952ee6197
2 changed files with 7 additions and 1 deletions

View File

@ -7,7 +7,7 @@ function create(myOpts) {
// TODO pre-generate URL
// 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 (!scope.length || scope.every(function (scp) {
return -1 !== opts.myOpts.session.scope.indexOf(scp);
@ -23,6 +23,7 @@ function create(myOpts) {
// maybe use inline instead?
, windowType: 'popup'
, scope: scope
, debug: opts.debug || myOpts.debug
}).then(function (session) {
return session;
});
@ -74,6 +75,8 @@ window.navigator.auth = {
var myOpts = {
directives: directives
, conf: conf
, debug: opts.debug
, scope: scope
};
return OAUTH3.implicitGrant(directives, {

View File

@ -836,6 +836,9 @@
);
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!");
}