Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ScopedUser Logout Error #103

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

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