Skip to content

Commit

Permalink
gotoURL call is only needed when running as a desktop app
Browse files Browse the repository at this point in the history
  • Loading branch information
besidev committed Nov 13, 2023
1 parent 73b5545 commit 9ab278e
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package one.jpro.platform.auth.example.login;

import atlantafx.base.theme.CupertinoLight;
import com.jpro.webapi.WebAPI;
import javafx.beans.binding.Bindings;
import javafx.scene.Node;
import javafx.scene.control.Label;
Expand Down Expand Up @@ -193,7 +194,12 @@ public Node authProviderView(final OAuth2AuthenticationProvider authProvider,
final var signInBox = createButtonWithDescription(
"Sign in with the selected authentication provider.", "Sign In",
event -> authProvider.authorizeUrl(authCredentials)
.thenAccept(url -> getSessionManager().gotoURL(url)));
.thenAccept(url -> {
// gotoURL call is only needed when running as a desktop app
if (!WebAPI.isBrowser()) {
getSessionManager().gotoURL(url);
}
}));

final var discoveryBox = createButtonWithDescription(
"The OpenID Connect Discovery provides a client with configuration details.",
Expand Down

0 comments on commit 9ab278e

Please sign in to comment.