More specific error when user needs to accept T&C?

Currently, when an account needs to accept the Terms & Conditions, the server responds with this error:

{“type”:“urn:acme:error:unauthorized”,“detail”:“Must agree to subscriber agreement before any further actions”,“status”:403}

The client is then supposed to present the agreement document to the user and ask for confirmation.

However, a software can only detect this case by parsing the human readable “detail” string, which is rather easy to break as the string is not part of the specifications and may change over time or on different CAs.

I propose to make a special problem type for this case, e.g. “urn:acme:error:noagreement”, so a client is able to distinguish this special case from other “unauthorized” cases.

1 Like