diff --git a/src/onedrive.d b/src/onedrive.d index c9888ce5..38888a83 100644 --- a/src/onedrive.d +++ b/src/onedrive.d @@ -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;