diff --git a/src/main/java/me/kavin/piped/server/ServerLauncher.java b/src/main/java/me/kavin/piped/server/ServerLauncher.java index d549b15..f88e7bc 100644 --- a/src/main/java/me/kavin/piped/server/ServerLauncher.java +++ b/src/main/java/me/kavin/piped/server/ServerLauncher.java @@ -318,6 +318,9 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher { case "login" -> { String redirectUri = request.getQueryParameter("redirect"); + if (redirectUri == null || redirectUri.equals("")) { + return HttpResponse.ofCode(400).withHtml("Missing redirect parameter"); + } State state = new State(new Identifier(24) + "." + redirectUri); Nonce nonce = new Nonce(); @@ -331,6 +334,9 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher { .nonce(nonce) .build(); + if(redirectUri.equals(Constants.FRONTEND_URL + "/login")) { + return HttpResponse.redirect302(oidcRequest.toURI().toString()); + } return HttpResponse.ok200().withHtml( "" + "

Warning:

You are trying to give
"