Skip to content

Commit

Permalink
Handling login error caused by redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
nirvn committed Jan 27, 2023
1 parent 2e285f9 commit 77e4062
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/core/qfieldcloudconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,18 @@ void QFieldCloudConnection::login()

setStatus( ConnectionStatus::Connecting );

// Handle login redirect as an error state
connect( reply, &NetworkReply::redirected, this, [=]() {
QNetworkReply *rawReply = reply->reply();
reply->deleteLater();
rawReply->deleteLater();

emit loginFailed( tr( "Login error due to unexpected redirect, please retry later" ) );

setStatus( ConnectionStatus::Disconnected );
return;
} );

connect( reply, &NetworkReply::finished, this, [=]() {
QNetworkReply *rawReply = reply->reply();

Expand Down

1 comment on commit 77e4062

@qfield-fairy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.