MCPcopy Create free account
hub / github.com/comaps/comaps / FindOauthCode

Function FindOauthCode

libs/editor/osm_auth.cpp:43–52  ·  view source on GitHub ↗

Parse URL in format "{OSM_OAUTH2_REDIRECT_URI}?code=XXXX". Extract code value

Source from the content-addressed store, hash-verified

41
42// Parse URL in format "{OSM_OAUTH2_REDIRECT_URI}?code=XXXX". Extract code value
43string FindOauthCode(string const & redirectUri)
44{
45 auto const url = url::Url::FromString(redirectUri);
46 string const * oauth2code = url.GetParamValue("code");
47
48 if (!oauth2code || oauth2code->empty())
49 return {};
50
51 return *oauth2code;
52}
53
54string FindAccessToken(string const & json)
55{

Callers 3

SendAuthRequestMethod · 0.70
FetchRequestTokenMethod · 0.70
UNIT_TESTFunction · 0.50

Calls 3

GetParamValueMethod · 0.80
FromStringFunction · 0.50
emptyMethod · 0.45

Tested by 1

UNIT_TESTFunction · 0.40