Skip to content

ScopedUser Logout Error#103

Open
djwglpuppy wants to merge 4 commits intociaranj:masterfrom
djwglpuppy:master
Open

ScopedUser Logout Error#103
djwglpuppy wants to merge 4 commits intociaranj:masterfrom
djwglpuppy:master

Conversation

@djwglpuppy
Copy link

I modified the logout request for scopes to try to delete a user account. If the user account for that scope does not exist... It will throw a more contextual error instead of simply user is undefined

throw new Error('ScopeError: there are no user credentials associated with the SCOPE requested (' +  authContext.scope + ')');

@djwglpuppy
Copy link
Author

I added an error object to the middlewareCallback

Line 93 of auth_middleware.js

          if( middlewareCallback) middlewareCallback(err);

Bottom of requestMethods.js

    } catch(error){
      err = new Error('There are no user credentials associated with the scope: "' +  authContext.scope + '"');
    }
  }
  logoutHandler( authContext, user, middlewareCallback(err));

@ciaranj
Copy link
Owner

ciaranj commented Jun 19, 2012

Sorry for the delay, quick question, I see you've chosen to attempt to access the object literal and catch any usage of 'undefined' in an exception handler, would you be adverse to testing the presence in a condition before trying to de-reference it, or is this a performance thing ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants