Closed wswoodruff closed 7 years ago
Please squash these commits if merged, I want the drama smileys to show on the repo loL
Hey– the boilerplate doesn't have anything to do with login or JWTs. I suggest packaging this up in its own repo, in such a way that one can pop it into an existing swagger ui. Also, look into swagger-client (used by swagger-ui)– you might be able to hook into responses properly rather than polling the DOM for responses.
This script assumes you have a POST route named login. It listens for a response and as long as "error" isn't in the response it saves the text content of the response field in localstorage. It assumes that the only thing returned from the login route is the JWT, no JSON object.
This doesn't check which site you're using so if you load up a new API, the authentication fields will be autopopulated with a JWT from another project.