Wizard + OAuth: Make opening a new browser after clicking back works again
authorOlivier Goffart <ogoffart@woboq.com>
Mon, 18 Jun 2018 10:43:21 +0000 (12:43 +0200)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:57:55 +0000 (10:57 +0100)
commit0155a4fa73b30973002263cfc22854b15cbcb9f4
treeefe77e78fd6b7980dcb1078277dc0febddf14e61
parentd8e761ab61a6b0d3fe62148193aca1076ff336a7
Wizard + OAuth: Make opening a new browser after clicking back works again

Issue #6574

When there is an error in the advanced page, OwncloudAdvancedSetupPage::updateStatus
(and others) call completeChanged(), which is connected to
QWizardPrivate::_q_updateButtonStates which will re-enable the back button from the
last page.

When the user click "back" and re-open the browser, the account's credentials
already have a oauth token set. So the call to the API to get a new token fails
because we use the previous token instead of using the client's secret_id.
Fix this with the HttpCredentials::DontAddCredentialsAttribute.

Now, this is still not working because the session cookies are confusing the
server.  So we'll clear the cookies when re-opening the browser
src/gui/creds/oauth.cpp
src/gui/wizard/owncloudoauthcredspage.cpp