Permalink
Browse files

add proper cancel state error check

  • Loading branch information...
1 parent 97bc1cc commit 9c5978daf657b24f0bdae705f2380a0945bff6e4 @jcleblanc committed May 3, 2012
Showing with 12 additions and 8 deletions.
  1. +12 −8 oauth2-php-paypal/auth.php
View
@@ -25,13 +25,17 @@
var_dump($profile);
} else {
- $auth_url = sprintf("%s?scope=%s&response_type=code&redirect_uri=%s&client_id=%s",
- AUTHORIZATION_ENDPOINT,
- urlencode("https://identity.x.com/xidentity/resources/profile/me"),
- urlencode(CALLBACK_URL),
- KEY);
-
- //forward user to PayPal auth page
- header("Location: $auth_url");
+ if (isset($_GET['error_uri'])){
+ echo "error";
+ } else {
+ $auth_url = sprintf("%s?scope=%s&response_type=code&redirect_uri=%s&client_id=%s",
+ AUTHORIZATION_ENDPOINT,
+ urlencode(PROFILE_ENDPOINT),
+ urlencode(CALLBACK_URL),
+ KEY);
+
+ //forward user to PayPal auth page
+ header("Location: $auth_url");
+ }
}
?>

0 comments on commit 9c5978d

Please sign in to comment.