Commit graph

3 commits

Author SHA1 Message Date
Lioncash
38b9d1780f verify_login: Make VerifyLogin exceptionless
This function can be simplified by attempting to find the username
within the JSON object and then only accessing it if it does. There's no
need to blindly access the data itself.

This also eliminates the need to copy the string to a local as well,
since we already have the element itself, we can just compare against
it. For the failure case, it's the same if we were checking that the
provided username string is empty.
2018-03-28 21:34:21 -04:00
hubslave
93fd55249b Fix build on platforms without std::string_view
json.hpp wants it, but it isn't always available. Rather than patch
json.hpp directly to remove the dependency, provide a json.h wrapper
header that subs in std::experimental::string_view using preprocessor
magic. All the consumers of json.hpp are in src/web_service, so the
wrapper header is placed there as well.
2018-03-02 18:15:45 +02:00
B3n30
28c726f205 WebService: Verify username and token (#2930)
* WebService: Verify username and token; Log errors in PostJson

* Fixup: added docstrings to the functions

* Webservice: Added Icons to the verification, imrpved error detection in cpr, fixup nits

* fixup: fmt warning
2017-09-18 21:18:26 -04:00