From 18808faead1b7bcdf27dab06e2ffcda1f0680979 Mon Sep 17 00:00:00 2001
From: enahum <nahumhbl@gmail.com>
Date: Tue, 30 Aug 2016 14:40:30 -0300
Subject: PLT-3994 Fix OAuth2: Properly handle allowing an app fails (#3888)

* PLT-3994 Fix OAuth2: Properly handle allowing an app fails

* Remove Content-Type from allowOAuth
---
 webapp/components/authorize.jsx | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

(limited to 'webapp/components/authorize.jsx')

diff --git a/webapp/components/authorize.jsx b/webapp/components/authorize.jsx
index 354b51ede..684bae589 100644
--- a/webapp/components/authorize.jsx
+++ b/webapp/components/authorize.jsx
@@ -2,9 +2,9 @@
 // See License.txt for license information.
 
 import Client from 'client/web_client.jsx';
+import FormError from 'components/form_error.jsx';
 
 import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
-
 import React from 'react';
 
 import icon50 from 'images/icon50x50.png';
@@ -52,8 +52,8 @@ export default class Authorize extends React.Component {
                     window.location.href = data.redirect;
                 }
             },
-            () => {
-                //Do nothing on error
+            (err) => {
+                this.setState({error: err.message});
             }
         );
     }
@@ -75,6 +75,15 @@ export default class Authorize extends React.Component {
             icon = icon50;
         }
 
+        let error;
+        if (this.state.error) {
+            error = (
+                <div className='prompt__error form-group'>
+                    <FormError error={this.state.error}/>
+                </div>
+            );
+        }
+
         return (
             <div className='container-fluid'>
                 <div className='prompt'>
@@ -137,6 +146,7 @@ export default class Authorize extends React.Component {
                             />
                         </button>
                     </div>
+                    {error}
                 </div>
             </div>
         );
-- 
cgit v1.2.3-1-g7c22

