Tumblr now also redirects to unauthorized page if no token found

This commit is contained in:
Sahat Yalkabov
2013-12-07 01:46:49 -05:00
parent 2c15e7774c
commit 388599ac28
3 changed files with 9 additions and 12 deletions

View File

@ -65,6 +65,13 @@ exports.getFoursquare = function(req, res) {
* GET /api/tumblr
*/
exports.getTumblr = function(req, res) {
if (!req.user.tokens.tumblr) {
return res.render('api/unauthorized', {
title: 'Tumblr API',
provider: 'Tumblr',
user: req.user
});
}
res.render('api/tumblr', {
title: 'Tumblr API',

View File

@ -6,14 +6,4 @@ block content
i.fa.fa-tumblr-square
| Tumblr API
if !user.tokens.tumblr
h3
i.fa.fa-shield
| Authorization Required
a(href='/auth/tumblr')
.label.label-primary.label-block
h2
i.fa.fa-qrcode
| Get Tumblr Token
else
h2 else
.btn.btn-success Authorized!

View File

@ -4,6 +4,6 @@ block content
h3
i.fa.fa-lock
| Authorization Required
a.btn.btn-lg.btn-primary(href='/auth/foursquare')
a.btn.btn-lg.btn-primary(href='/auth/tumblr')
i.fa.fa-qrcode
| Get #{provider} Token