Skip to content

Commit

Permalink
workaround for rowdy missing CORS header for error response
Browse files Browse the repository at this point in the history
  • Loading branch information
abby committed Jul 12, 2017
1 parent 674c107 commit d3e516a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions dist/swagger-ui-bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/swagger-ui-bundle.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/swagger-ui.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/swagger-ui.js.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion src/core/plugins/auth/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,15 @@ export const authorizeToken = ( auth ) => ( { fn, authActions, errActions } ) =>
})
.catch(e => {
let err = new Error(e)

// workaround for actual error response, e.g. failed authentication, masked
// by general failed to fetch error due to missing CORS header from rowdy
// for error responses
err.message = 'Unauthorized. Please check your username and password.'

errActions.newAuthErr( {
authId: name,
level: "error",
level: "error:",
source: "auth",
message: err.message
} )
Expand Down

0 comments on commit d3e516a

Please sign in to comment.