Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

add proper cancel state error check

  • Loading branch information...
commit 9c5978daf657b24f0bdae705f2380a0945bff6e4 1 parent 97bc1cc
@jcleblanc authored
Showing with 12 additions and 8 deletions.
  1. +12 −8 oauth2-php-paypal/auth.php
View
20 oauth2-php-paypal/auth.php
@@ -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");
+ }
}
?>
Please sign in to comment.
Something went wrong with that request. Please try again.