| 16 | } |
| 17 | |
| 18 | APIRequest::APIRequest(format::Url url, AuthMode authMode, bool newCheckStatus) : Request(MaybeAppendSession(authMode, url).ToByteString()), checkStatus(newCheckStatus) |
| 19 | { |
| 20 | auto user = Client::Ref().GetAuthUser(); |
| 21 | if ((authMode == authRequire || |
| 22 | authMode == authRequireAppendSession) && !user) |
| 23 | { |
| 24 | FailEarly("Not authenticated"); |
| 25 | return; |
| 26 | } |
| 27 | if (authMode != authOmit && user) |
| 28 | { |
| 29 | AuthHeaders(ByteString::Build(user->UserID), user->SessionID); |
| 30 | } |
| 31 | } |
| 32 | |
| 33 | Json::Value APIRequest::Finish() |
| 34 | { |
nothing calls this directly
no test coverage detected