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
calling setter for ctx.body should include the json.dumps so that user doesn't have to call it in the route like this:
print(ctx.auth, "ctx.auth")
if ctx.auth and ctx.auth.get('user'):
ctx.body = json.dumps({"message": "This is protected content. Only authenticated users can see this. I hope you feel special 🍊🍊🍊."})
ctx.send(200, content_type='application/json')
else:
ctx.body = json.dumps({"message": "Unauthorized"})
ctx.send(401, content_type='application/json')
```
The text was updated successfully, but these errors were encountered:
calling setter for ctx.body should include the json.dumps so that user doesn't have to call it in the route like this:
The text was updated successfully, but these errors were encountered: