Skip to content

Commit

Permalink
26.0.2.1-rpan
Browse files Browse the repository at this point in the history
  • Loading branch information
ObsidianSnoo committed Feb 23, 2021
1 parent d5c0c62 commit e178233
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 1,401 deletions.
313 changes: 0 additions & 313 deletions UI/auth-mixer.cpp

This file was deleted.

30 changes: 0 additions & 30 deletions UI/auth-mixer.hpp

This file was deleted.

21 changes: 11 additions & 10 deletions UI/window-reddit-login-dialog2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "window-reddit-login-dialog2.hpp"

#include <QDesktopServices>
#include <QUrlQuery>
#include <json11.hpp>

#include "api-reddit.hpp"
Expand Down Expand Up @@ -226,18 +227,18 @@ void RedditLoginDialog2::AuthorizeResult(const QString &text,
for (const QString &header : responseHeaders) {
if (header.left(10) == "location: ") {
QString val = header.mid(10);
int codeIdx = val.indexOf("code=");
if (codeIdx < 0) {
SetPage(PAGE_SIGNIN);
QUrl location(val);
QUrlQuery query(location);

if(!query.hasQueryItem("code")) {
SetPage(PAGE_SIGNIN);
serverTextResponse.reset(new QString(text));
serverErrorResponse.reset(new QString(errorText));
errorStep = QTStr("Reddit.ErrorLog.Step.Authorization");
return;
}
int codeEndIdx = val.indexOf('&', codeIdx);
if (codeEndIdx < 0) {
newCode = val.mid(codeIdx + 5);
} else {
newCode = val.mid(codeIdx + 5,
codeIdx + 5 - codeEndIdx);
}

newCode = query.queryItemValue("code");
break;
}
}
Expand Down
Loading

0 comments on commit e178233

Please sign in to comment.