diff --git a/examples/server_auth/routes/index.js b/examples/server_auth/routes/index.js index 70e9dfe..9cf0922 100644 --- a/examples/server_auth/routes/index.js +++ b/examples/server_auth/routes/index.js @@ -37,8 +37,7 @@ router.get('/', function(req, res) { if (typeof authCode !== 'undefined') { podio.getAccessToken(authCode, redirectURL, function (err) { - // we are ready to make API calls - res.render('success'); + res.render('error', { description: 'Error:' + err.status + " / " + err.message }); }); } else if (typeof errorCode !== 'undefined') { // an error occured @@ -51,13 +50,13 @@ router.get('/', function(req, res) { }); router.get('/user', function(req, res) { - + podio.isAuthenticated() .then(function() { return podio.request('get', '/user/status'); }) .then(function(responseData) { - res.render('user', { profile: responseData.profile }); + res.render('user', { profile: responseData.profile }); }) .catch(function(err) { res.send(401);