Showing the changes to interface/src/ui/OAuthWebViewHandler.cpp (1 of 5 files). Show all
Unified · Split
| @@ -21,7 +21,9 @@ OAuthWebViewHandler& OAuthWebViewHandler::getInstance() { · 20 unmodified lines | ||
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | OAuthWebViewHandler::OAuthWebViewHandler() : |
| 24 | − _activeWebView(NULL) | |
| 24 | + _activeWebView(NULL), | |
| 25 | + _webViewRedisplayTimer(), | |
| 26 | + _lastAuthorizationURL() | |
| 25 | 27 | { |
| 26 | 28 | |
| 27 | 29 | } |
| @@ -41,7 +43,19 @@ void OAuthWebViewHandler::addHighFidelityRootCAToSSLConfig() { · 13 unmodified lines | ||
| 41 | 43 | const int WEB_VIEW_REDISPLAY_ELAPSED_MSECS = 5 * 1000; |
| 42 | 44 | |
| 43 | 45 | void OAuthWebViewHandler::displayWebviewForAuthorizationURL(const QUrl& authorizationURL) { |
| 44 | − if (!_activeWebView && _webViewRedisplayTimer.elapsed() >= WEB_VIEW_REDISPLAY_ELAPSED_MSECS) { | |
| 46 | + if (!_activeWebView) { | |
| 47 | + | |
| 48 | + if (!_lastAuthorizationURL.isEmpty()) { | |
| 49 | + if (_lastAuthorizationURL.host() == authorizationURL.host() | |
| 50 | + && _webViewRedisplayTimer.elapsed() < WEB_VIEW_REDISPLAY_ELAPSED_MSECS) { | |
| 51 | + // this would be re-displaying an OAuth dialog for the same auth URL inside of the redisplay ms | |
| 52 | + // so return instead | |
| 53 | + return; | |
| 54 | + } | |
| 55 | + } | |
| 56 | + | |
| 57 | + _lastAuthorizationURL = authorizationURL; | |
| 58 | + | |
| 45 | 59 | _activeWebView = new QWebView; |
| 46 | 60 | |
| 47 | 61 | // keep the window on top and delete it when it closes |