Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
DonMartin76 committed Nov 12, 2018
1 parent 37e7e23 commit 12945b5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/common/utils-oauth2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ export class UtilsOAuth2 {
throw makeError('Invalid or empty client_id.', 400);
if (!authRequest.redirect_uri)
throw makeError('Invalid or empty redirect_uri', 400);
const subsValidation = await instance.validateSubscription(authRequest);
let subsValidation: SubscriptionValidation;
try {
subsValidation = await instance.validateSubscription(authRequest);
} catch (err) {
// Otherwise this would return a JSON instead of a HTML error page.
// See https://github.com/Haufe-Lexware/wicked.haufe.io/issues/137
delete err.oauthError;
throw err;
}
const application = subsValidation.subsInfo.application;
if (!application.redirectUri)
throw makeError('The application associated with the given client_id does not have a registered redirect_uri.', 400);
Expand Down

0 comments on commit 12945b5

Please sign in to comment.