mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2025-01-10 03:20:30 +05:30
Format all code.
This commit is contained in:
parent
946ac458ed
commit
0eb235180b
@ -2,8 +2,12 @@ package me.kavin.piped.server;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.nimbusds.oauth2.sdk.*;
|
||||
import com.nimbusds.oauth2.sdk.auth.ClientAuthentication;
|
||||
import com.nimbusds.oauth2.sdk.auth.ClientSecretBasic;
|
||||
import com.nimbusds.oauth2.sdk.id.Identifier;
|
||||
import com.nimbusds.oauth2.sdk.id.State;
|
||||
import com.nimbusds.openid.connect.sdk.*;
|
||||
import com.nimbusds.openid.connect.sdk.claims.UserInfo;
|
||||
import com.rometools.rome.feed.synd.SyndFeed;
|
||||
import com.rometools.rome.io.SyndFeedInput;
|
||||
@ -21,8 +25,8 @@ import me.kavin.piped.server.handlers.auth.AuthPlaylistHandlers;
|
||||
import me.kavin.piped.server.handlers.auth.FeedHandlers;
|
||||
import me.kavin.piped.server.handlers.auth.StorageHandlers;
|
||||
import me.kavin.piped.server.handlers.auth.UserHandlers;
|
||||
import me.kavin.piped.utils.*;
|
||||
import me.kavin.piped.utils.ErrorResponse;
|
||||
import me.kavin.piped.utils.*;
|
||||
import me.kavin.piped.utils.obj.MatrixHelper;
|
||||
import me.kavin.piped.utils.obj.OidcProvider;
|
||||
import me.kavin.piped.utils.obj.federation.FederatedVideoInfo;
|
||||
@ -35,14 +39,10 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.schabi.newpipe.extractor.exceptions.ParsingException;
|
||||
import org.schabi.newpipe.extractor.localization.DateWrapper;
|
||||
import org.xml.sax.InputSource;
|
||||
import com.nimbusds.oauth2.sdk.*;
|
||||
import com.nimbusds.openid.connect.sdk.*;
|
||||
import com.nimbusds.oauth2.sdk.id.*;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.net.InetSocketAddress;
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Executor;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
@ -339,9 +339,10 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
|
||||
case "login" -> {
|
||||
String redirectUri = request.getQueryParameter("redirect");
|
||||
|
||||
if (redirectUri == null || redirectUri.equals("")) {
|
||||
if (StringUtils.isBlank(redirectUri)) {
|
||||
return HttpResponse.ofCode(400).withHtml("Missing redirect parameter");
|
||||
}
|
||||
|
||||
State state = new State(new Identifier(24) + "." + redirectUri);
|
||||
Nonce nonce = new Nonce();
|
||||
|
||||
@ -674,6 +675,7 @@ public class ServerLauncher extends MultithreadedHttpServerLauncher {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private static String[] getArray(String s) {
|
||||
|
||||
if (s == null) {
|
||||
|
@ -108,6 +108,7 @@ public class UserHandlers {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static String oidcCallbackResponse(String provider, String uid) {
|
||||
try (Session s = DatabaseSessionFactory.createSession()) {
|
||||
String dbName = provider + "-" + uid;
|
||||
@ -134,6 +135,7 @@ public class UserHandlers {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static byte[] deleteUserResponse(String session, String pass) throws IOException {
|
||||
if (StringUtils.isBlank(session))
|
||||
ExceptionHandler.throwErrorResponse(new InvalidRequestResponse("session is a required parameter"));
|
||||
|
Loading…
Reference in New Issue
Block a user