Skip to content

Commit

Permalink
1.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
adrielcafe committed Sep 20, 2016
1 parent 1958b54 commit b81e50c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 17 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ repositories {
}
dependencies {
compile 'com.github.adrielcafe:AndroidOAuth:1.1.3'
compile 'com.github.adrielcafe:AndroidOAuth:1.1.4'
}
```

Expand Down
6 changes: 3 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
compileSdkVersion 24
buildToolsVersion "24.0.1"

defaultConfig {
applicationId "cafe.adriel.androidoauth"
Expand All @@ -20,6 +20,6 @@ android {
}

dependencies {
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.android.support:appcompat-v7:24.2.1'
compile project(':lib')
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package cafe.adriel.androidoauth.example;

public class Credentials {
public static final String GOOGLE_CLIENT_ID = "REPLACE";
public static final String GOOGLE_CLIENT_SECRET = "REPLACE";
public static final String GOOGLE_REDIRECT_URI = "REPLACE";
public static final String GOOGLE_CLIENT_ID = "940891630461-uh38ng1a01tfkmu926g5f4el56h9hock.apps.googleusercontent.com";
public static final String GOOGLE_CLIENT_SECRET = "oxvq5lNSJvdM_zwZgc_appQV";
public static final String GOOGLE_REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob:auto";

public static final String FACEBOOK_APP_ID = "REPLACE";
public static final String FACEBOOK_APP_SECRET = "REPLACE";
public static final String FACEBOOK_REDIRECT_URI = "REPLACE";
public static final String FACEBOOK_APP_ID = "1540807289473122";
public static final String FACEBOOK_APP_SECRET = "236e282277e8ee3150c447cf0307bcb3";
public static final String FACEBOOK_REDIRECT_URI = "http://demo.xarx.rocks/";
}
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.3'
classpath 'com.android.tools.build:gradle:2.2.0'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,14 @@ private void getCode(String url) {
Uri uri = Uri.parse(url);
String receivedState = uri.getQueryParameter("state");
code = uri.getQueryParameter("code");
if (code != null && !code.isEmpty() && originalState.equals(receivedState)) {
callback.onSuccess(code);
} else {
String error = String.format("Wrong state: %s (original) != %s (received)",
originalState, receivedState);
callback.onError(new Exception(error));
if (callback != null) {
if (code != null && !code.isEmpty() && originalState.equals(receivedState)) {
callback.onSuccess(code);
} else {
String error = String.format("Wrong state: %s (original) != %s (received)",
originalState, receivedState);
callback.onError(new Exception(error));
}
}
dismiss();
}
Expand Down

0 comments on commit b81e50c

Please sign in to comment.