Home > Enterprise >  Server response when user was authenticated
Server response when user was authenticated

Time:07-12

I am poking around client-server communication, and I am stuck on a problem, where I don't know what the server should respond with, when the user authentication has been successful, or not. Do I want to respond with just a "True" or "False", or are there more intricate responses when designing a server?

CodePudding user response:

I think you can return

 {"state":500, "msg":"auth failed"}

for interfaces that need that auth. And return actual data

{"data":{"twits":[...]}} 

for non-auth-required interfaces

  • Related