In Auth0, you check if an error occured with the string condition but a better way would be to check its status_code, like: if verified.status_code != 200: ..., and then parse it as json().
Instead of using prints, I think we should stick to the context.logger. Then you could specify log levels explicitly, so in except blocks you would use context.logger.error("..."), and for informational messages context.logger.info("...") etc.
Little inconsistency - in Auth0, asyncio.gather() is inside the try-except block, but in Stripe it is not.
And of course, as @MichalCz stated, constant variables should be introduced!:D
This line seems to be a leftover.
In Auth0, you check if an error occured with the string condition but a better way would be to check its status_code, like:
if verified.status_code != 200: ...
, and then parse it asjson()
.The get_auth() is async so I think these:
requests could be made asynchronously.
Instead of using prints, I think we should stick to the context.logger. Then you could specify log levels explicitly, so in except blocks you would use
context.logger.error("...")
, and for informational messagescontext.logger.info("...")
etc.Little inconsistency - in Auth0, asyncio.gather() is inside the try-except block, but in Stripe it is not.
And of course, as @MichalCz stated, constant variables should be introduced!:D