mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-03 06:22:18 +02:00
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:
parent
5d821c4440
commit
a1e326f9b4
|
@ -75,7 +75,7 @@ final class OneDriveApi
|
||||||
write(url, "\n\n", "Enter the response uri: ");
|
write(url, "\n\n", "Enter the response uri: ");
|
||||||
readln(response);
|
readln(response);
|
||||||
// match the authorization code
|
// match the authorization code
|
||||||
auto c = matchFirst(response, r"(?:(\?|&)code=)([\w\d-]+)");
|
auto c = matchFirst(response, r"(?:[\?|&]code=)([\w\d-]+)");
|
||||||
if (c.empty) {
|
if (c.empty) {
|
||||||
log.log("Invalid uri");
|
log.log("Invalid uri");
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in a new issue