From 636f6dc21d6a017de25a95674283c77a4080eeff Mon Sep 17 00:00:00 2001
From: Nicolas Le Goff
Date: Fri, 13 Apr 2012 15:47:29 +0200
Subject: [PATCH] fix native auth flow
---
lib/classes/API/OAuth2/Adapter.class.php | 4 ++--
templates/web/api/auth/native_app_access_token.twig | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/lib/classes/API/OAuth2/Adapter.class.php b/lib/classes/API/OAuth2/Adapter.class.php
index d1af88278e..7d61431173 100644
--- a/lib/classes/API/OAuth2/Adapter.class.php
+++ b/lib/classes/API/OAuth2/Adapter.class.php
@@ -597,8 +597,8 @@ class API_OAuth2_Adapter extends OAuth2
}
else
{
- if ($response_type == OAUTH2_AUTH_RESPONSE_TYPE_AUTH_CODE || $response_type == OAUTH2_AUTH_RESPONSE_TYPE_CODE_AND_TOKEN)
- $result["token"] = $this->createAccessToken($account_id, $scope);
+ if ($response_type == OAUTH2_AUTH_RESPONSE_TYPE_AUTH_CODE)
+ $result["code"] = $this->createAuthCode($account_id, $redirect_uri, $scope);
if ($response_type == OAUTH2_AUTH_RESPONSE_TYPE_ACCESS_TOKEN)
$result["error"] = OAUTH2_ERROR_UNSUPPORTED_RESPONSE_TYPE;
diff --git a/templates/web/api/auth/native_app_access_token.twig b/templates/web/api/auth/native_app_access_token.twig
index 9b438febf4..d16b7c5677 100644
--- a/templates/web/api/auth/native_app_access_token.twig
+++ b/templates/web/api/auth/native_app_access_token.twig
@@ -58,7 +58,7 @@
{{error}}
{% endtrans %}
-
+
{% else %}
@@ -70,7 +70,7 @@
Copiez le code ci-dessous, retournez dans votre application et collez-le à l'endroit requis :
{% endtrans %}
-
+
{% endif %}