// Path: library/src/main/java/com/pokegoapi/exceptions/request/InvalidCredentialsException.java
// public class InvalidCredentialsException extends RequestFailedException {
// 	public InvalidCredentialsException() {
// 		super();
// 	}
// 
// 	public InvalidCredentialsException(String reason) {
// 		super(reason);
// 	}
// 
// 	public InvalidCredentialsException(Throwable exception) {
// 		super(exception);
// 	}
// 
// 	public InvalidCredentialsException(String reason, Throwable exception) {
// 		super(reason, exception);
// 	}
// }


import POGOProtos.Networking.Envelopes.RequestEnvelopeOuterClass.RequestEnvelope.AuthInfo;
import com.pokegoapi.exceptions.request.InvalidCredentialsException;
import com.pokegoapi.exceptions.request.LoginFailedException;
import com.pokegoapi.util.SystemTimeImpl;
import com.pokegoapi.util.Time;
import com.squareup.moshi.Moshi;
import lombok.Setter;
import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.FormBody;
import okhttp3.FormBody.Builder;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
				postResponse = client.newBuilder()
						.followRedirects(false)
						.followSslRedirects(false)
						.build()
						.newCall(postRequest)
						.execute();
			} catch (IOException e) {
				throw new LoginFailedException("Network failure", e);
			}

			String postBody;
			try {
				postBody = postResponse.body().string();
			} catch (IOException e) {
				throw new LoginFailedException("Response body fetching failed", e);
			}

			List<Cookie> cookies = client.cookieJar().loadForRequest(HttpUrl.parse(LOGIN_URL));
			for (Cookie cookie : cookies) {
				if (cookie.name().startsWith("CASTGC")) {
					this.tokenId = cookie.value();
					expiresTimestamp = time.currentTimeMillis() + 7140000L;
					return;
				}
			}

			if (postBody.length() > 0) {
				try {
					String[] errors = moshi.adapter(PtcAuthError.class).fromJson(postBody).errors;
					if (errors != null && errors.length > 0) {
// Path: library/src/main/java/com/pokegoapi/exceptions/request/InvalidCredentialsException.java
// public class InvalidCredentialsException extends RequestFailedException {
// 	public InvalidCredentialsException() {
// 		super();
// 	}
// 
// 	public InvalidCredentialsException(String reason) {
// 		super(reason);
// 	}
// 
// 	public InvalidCredentialsException(Throwable exception) {
// 		super(exception);
// 	}
// 
// 	public InvalidCredentialsException(String reason, Throwable exception) {
// 		super(reason, exception);
// 	}
// }


// Path: library/src/main/java/com/pokegoapi/auth/PtcCredentialProvider.java
import POGOProtos.Networking.Envelopes.RequestEnvelopeOuterClass.RequestEnvelope.AuthInfo;
import com.pokegoapi.exceptions.request.InvalidCredentialsException;
import com.pokegoapi.exceptions.request.LoginFailedException;
import com.pokegoapi.util.SystemTimeImpl;
import com.pokegoapi.util.Time;
import com.squareup.moshi.Moshi;
import lombok.Setter;
import okhttp3.Cookie;
import okhttp3.CookieJar;
import okhttp3.FormBody;
import okhttp3.FormBody.Builder;
import okhttp3.HttpUrl;
import okhttp3.Interceptor;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
import java.io.IOException;
import java.security.SecureRandom;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

				postResponse = client.newBuilder()
						.followRedirects(false)
						.followSslRedirects(false)
						.build()
						.newCall(postRequest)
						.execute();
			} catch (IOException e) {
				throw new LoginFailedException("Network failure", e);
			}

			String postBody;
			try {
				postBody = postResponse.body().string();
			} catch (IOException e) {
				throw new LoginFailedException("Response body fetching failed", e);
			}

			List<Cookie> cookies = client.cookieJar().loadForRequest(HttpUrl.parse(LOGIN_URL));
			for (Cookie cookie : cookies) {
				if (cookie.name().startsWith("CASTGC")) {
					this.tokenId = cookie.value();
					expiresTimestamp = time.currentTimeMillis() + 7140000L;
					return;
				}
			}

			if (postBody.length() > 0) {
				try {
					String[] errors = moshi.adapter(PtcAuthError.class).fromJson(postBody).errors;
					if (errors != null && errors.length > 0) {
						throw new InvalidCredentialsException(errors[0]);