Changeset 18786 in josm for trunk/src


Ignore:
Timestamp:
2023-07-27T15:47:48+02:00 (2 years ago)
Author:
taylor.smock
Message:

Fix #23083: SocketTimeoutException in OAuth20Authorization$OAuth20AuthorizationHandler.handleRequest

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/oauth/OAuth20Authorization.java

    r18665 r18786  
    102102                } catch (IOException | OAuth20Exception e) {
    103103                    consumer.accept(Optional.empty());
    104                     throw new JosmRuntimeException(e);
     104                    throw new RequestHandler.RequestHandlerErrorException(e);
    105105                } finally {
    106106                    tradeCodeForToken.disconnect();
    107107                }
    108108            } catch (MalformedURLException e) {
    109                 throw new JosmRuntimeException(e);
     109                consumer.accept(Optional.empty());
     110                throw new RequestHandler.RequestHandlerBadRequestException(e);
    110111            }
    111112            return null;
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java

    r18764 r18786  
    2121import javax.swing.JCheckBox;
    2222import javax.swing.JLabel;
     23import javax.swing.JOptionPane;
    2324import javax.swing.JPanel;
    2425
     
    375376                    OAuthAccessTokenHolder.getInstance().save(CredentialsManager.getInstance());
    376377                    GuiHelper.runInEDT(OAuthAuthenticationPreferencesPanel.this::refreshView);
     378                    if (!token.isPresent()) {
     379                        GuiHelper.runInEDT(() -> JOptionPane.showMessageDialog(MainApplication.getMainPanel(),
     380                                tr("Authentication failed, please check browser for details."),
     381                                tr("OAuth Authentication Failed"),
     382                                JOptionPane.ERROR_MESSAGE));
     383                    }
    377384                }, OsmScopes.read_gpx, OsmScopes.write_gpx,
    378385                        OsmScopes.read_prefs, OsmScopes.write_prefs,
Note: See TracChangeset for help on using the changeset viewer.