You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I see some potential improvements in JWT Authenticator module which we use in every Topcoder API. Right now, if there is any error with the JWT token, the authenticator directly respond with 403 (Ideally it should have been 401) response and the API which uses that module doesn't get chance to modify the API response if necessary.
The response structure used in JWT Authenticator for error response wrapping is not in compliance with V5 standards and it creates inconsistency between Swagger and actual API response.
I recommend to return the error in next() callback instead of returning the response directly so that the API can handle the error and return error response in compliance with V5 standards.
I hope it makes sense. If not, please let me know.
I see some potential improvements in JWT Authenticator module which we use in every Topcoder API. Right now, if there is any error with the JWT token, the authenticator directly respond with 403 (Ideally it should have been 401) response and the API which uses that module doesn't get chance to modify the API response if necessary.
https://github.com/appirio-tech/tc-core-library-js/blob/master/lib/middleware/jwtAuthenticator.js#L33-L35
The response structure used in JWT Authenticator for error response wrapping is not in compliance with V5 standards and it creates inconsistency between Swagger and actual API response.
I recommend to return the error in
next()
callback instead of returning the response directly so that the API can handle the error and return error response in compliance with V5 standards.I hope it makes sense. If not, please let me know.
cc @cwdcwd @sachin-maheshwari
The text was updated successfully, but these errors were encountered: