Skip to content

Commit

Permalink
Changed wordpress_logged_in to quantimodo_logged_in cookie & "https:/…
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepsinn committed Jan 15, 2018
1 parent 06ec710 commit b36641d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
3 changes: 3 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ buildscript {
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}

Expand Down
3 changes: 3 additions & 0 deletions quantimodo-sdk-tools/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ apply plugin: 'com.neenbedankt.android-apt'
repositories {
mavenCentral()
jcenter()
maven {
url "https://maven.google.com"
}
}

android {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public static String logIn(final Context context) throws ExecutionException, Int
List<HttpCookie> cookieList = cookieStore.get(URI.create(QUANTIMODO_ADDRESS));

for (HttpCookie cookie : cookieList) {
if (cookie.getName().contains("wordpress_logged_in_")) {
if (cookie.getName().contains("quantimodo_logged_in_")) {
cookieToken = cookie.getValue();
break;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,10 @@ public QMAuthClient(OnAuthenticationCompleteListener listener, ToolsPrefs toolsP
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith(toolsPrefs.getApiUrl())) {
String cookies = cookieManager.getCookie(toolsPrefs.getApiUrl());
if (cookies != null && cookies.contains("wordpress_logged_in")) {
if (cookies != null && cookies.contains("quantimodo_logged_in")) {
String[] splits = cookies.split("; ");
for (String cookie : splits) {
if (cookie.startsWith("wordpress_logged_in")) {
if (cookie.startsWith("quantimodo_logged_in")) {
listener.onSuccess(cookie);
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static String logIn(final Context context) throws ExecutionException, Int
List<HttpCookie> cookieList = cookieStore.get(URI.create(QUANTIMODO_ADDRESS));

for (HttpCookie cookie : cookieList) {
if (cookie.getName().contains("wordpress_logged_in_")) {
if (cookie.getName().contains("quantimodo_logged_in_")) {
return cookie.getValue();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ public QMAuthClient(OnAuthenticationCompleteListener listener) {
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.startsWith(ToolsPrefs.getInstance().getApiUrl())) {
String cookies = cookieManager.getCookie(ToolsPrefs.getInstance().getApiUrl());
if (cookies != null && cookies.contains("wordpress_logged_in")) {
if (cookies != null && cookies.contains("quantimodo_logged_in")) {
String[] splits = cookies.split("; ");
for (String cookie : splits) {
if (cookie.startsWith("wordpress_logged_in")) {
if (cookie.startsWith("quantimodo_logged_in")) {
listener.onSuccess(cookie);
return true;
}
Expand Down
3 changes: 3 additions & 0 deletions testing-utils/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ apply plugin: 'com.android.library'

repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}

android {
Expand Down

0 comments on commit b36641d

Please sign in to comment.