Skip to content

Commit

Permalink
Fix persistent two factor auth notification.
Browse files Browse the repository at this point in the history
The server app returns a 202 code when the request succeeded, which was
not taken into account.

Signed-off-by: Camila <[email protected]>
  • Loading branch information
Camila committed Sep 21, 2022
1 parent 5766d32 commit 9a18128
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/gui/ocsjob.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
#define OCS_SUCCESS_STATUS_CODE 100
// Apparantly the v2.php URLs can return that
#define OCS_SUCCESS_STATUS_CODE_V2 200
// Two factor auth notification returns Accepted 202
#define OCS_ACCEPTED_STATUS_CODE 202
// not modified when using ETag
#define OCS_NOT_MODIFIED_STATUS_CODE_V2 304

Expand Down
6 changes: 4 additions & 2 deletions src/gui/tray/usermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,10 @@ void User::slotNotificationRequestFinished(int statusCode)
{
int row = sender()->property("activityRow").toInt();

// the ocs API returns stat code 100 or 200 inside the xml if it succeeded.
if (statusCode != OCS_SUCCESS_STATUS_CODE && statusCode != OCS_SUCCESS_STATUS_CODE_V2) {
// the ocs API returns stat code 100 or 200 or 202 inside the xml if it succeeded.
if (statusCode != OCS_SUCCESS_STATUS_CODE
&& statusCode != OCS_SUCCESS_STATUS_CODE_V2
&& statusCode != OCS_ACCEPTED_STATUS_CODE) {
qCWarning(lcActivity) << "Notification Request to Server failed, leave notification visible.";
} else {
// to do use the model to rebuild the list or remove the item
Expand Down

0 comments on commit 9a18128

Please sign in to comment.