invalid_grant, error 70000

when trying to redeem an code, this error always occured, no matter
which parts of the response uri/url that was used.

the old regexp for parsing the code contained 3 groups, where as the
actual code always was the last group, and the second group was either ?
or &, and the first group would've been everything up until "code=".

changed from a matching group to character class so there would only be
two matching groups, so calling popFront() would actually leave the
authorization code in the front.
This commit is contained in:
Mikael Göransson 2018-01-20 19:47:09 +01:00
parent 5d821c4440
commit a1e326f9b4

View file

@ -75,7 +75,7 @@ final class OneDriveApi
write(url, "\n\n", "Enter the response uri: ");
readln(response);
// match the authorization code
auto c = matchFirst(response, r"(?:(\?|&)code=)([\w\d-]+)");
auto c = matchFirst(response, r"(?:[\?|&]code=)([\w\d-]+)");
if (c.empty) {
log.log("Invalid uri");
return false;