Move JS into HTML and add NOT_LOGGED_IN handling

For some reason the JS never got loaded when it was in it's own
file, therefor I moved it into the HTML where it gets called.

Also when a session id on the server was expired or something, you
weren't able to log out, there is now code which fixes that.
This commit is contained in:
Jeena 2018-09-11 01:05:23 +02:00
parent 2c263f77db
commit 0a195f8a8f
5 changed files with 99 additions and 88 deletions

View file

@ -99,6 +99,18 @@ void TinyTinyRSSLogin::reply()
qWarning() << mLoginError;
emit loginErrorChanged(mLoginError);
if(mLoginError == "NOT_LOGGED_IN") {
mSessionId = nullptr;
mServerUrl = nullptr;
QSettings settings;
settings.remove("sessionId");
settings.remove("serverUrl");
settings.sync();
emit sessionIdChanged(mSessionId);
}
} else {
mSessionId = json.object().value("content").toObject().value("session_id").toString();