Skip to content

Commit adb4c3a

Browse files
s7092910Grover-c13
authored andcommitted
Changed private fields to protected to allow extending of the Providers for API users without having to rewrite the whole class. (#350)
1 parent 4726d04 commit adb4c3a

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

src/main/java/com/pokegoapi/auth/GoogleUserCredentialProvider.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,19 +39,19 @@ public class GoogleUserCredentialProvider extends CredentialProvider {
3939
public static final String LOGIN_URL = "https://accounts.google.com/o/oauth2/auth?client_id=848232511240-73ri3t7plvk96pj4f85uj8otdat2alem.apps.googleusercontent.com&redirect_uri=urn%3Aietf%3Awg%3Aoauth%3A2.0%3Aoob&response_type=code&scope=openid%20email%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fuserinfo.email";
4040
private static final String TAG = GoogleUserCredentialProvider.class.getSimpleName();
4141
//We try and refresh token 5 minutes before it actually expires
42-
private static final long REFRESH_TOKEN_BUFFER_TIME = 5 * 60 * 1000;
43-
private final OkHttpClient client;
42+
protected static final long REFRESH_TOKEN_BUFFER_TIME = 5 * 60 * 1000;
43+
protected final OkHttpClient client;
4444

45-
private final Time time;
45+
protected final Time time;
4646

47-
private long expiresTimestamp;
47+
protected long expiresTimestamp;
4848

49-
private String tokenId;
49+
protected String tokenId;
5050

5151
@Getter
52-
private String refreshToken;
52+
protected String refreshToken;
5353

54-
private AuthInfo.Builder authbuilder;
54+
protected AuthInfo.Builder authbuilder;
5555

5656
/**
5757
* Used for logging in when one has a persisted refreshToken.

src/main/java/com/pokegoapi/auth/PtcCredentialProvider.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,15 +46,15 @@ public class PtcCredentialProvider extends CredentialProvider {
4646
public static final String USER_AGENT = "niantic";
4747
private static final String TAG = PtcCredentialProvider.class.getSimpleName();
4848
//We try and refresh token 5 minutes before it actually expires
49-
private static final long REFRESH_TOKEN_BUFFER_TIME = 5 * 60 * 1000;
50-
51-
private final OkHttpClient client;
52-
private final String username;
53-
private final String password;
54-
private final Time time;
55-
private String tokenId;
56-
private long expiresTimestamp;
57-
private AuthInfo.Builder authbuilder;
49+
protected static final long REFRESH_TOKEN_BUFFER_TIME = 5 * 60 * 1000;
50+
51+
protected final OkHttpClient client;
52+
protected final String username;
53+
protected final String password;
54+
protected final Time time;
55+
protected String tokenId;
56+
protected long expiresTimestamp;
57+
protected AuthInfo.Builder authbuilder;
5858

5959
/**
6060
* Instantiates a new Ptc login.

0 commit comments

Comments
 (0)