Skip to content

Commit

Permalink
new uaa
Browse files Browse the repository at this point in the history
  • Loading branch information
weiwei162 committed Jun 23, 2017
1 parent d46b6bb commit 32cd37e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tasks/helpers/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = {
//get user info
request({
method: 'get',
url: self.serverUrl + '/api/user',
url: self.serverUrl + '/api/user/info',
headers: {
'Authorization': self.accessToken
}
Expand All @@ -62,14 +62,14 @@ module.exports = {
var rewriteMiddleware = rewriteModule.getMiddleware([
{
from: '^/login(.*)$',
to: uaa.serverUrl + '/oauth/authorize$1&response_type=code&scope=&client_id=' + uaa.clientId + '&redirect_uri=' + uaa.redirect_uri,
to: uaa.serverUrl + '/oauth/authorize$1&response_type=code&scope=user_info&client_id=' + uaa.clientId + '&redirect_uri=' + uaa.redirect_uri,
redirect: 'permanent'
},
{
from: '^/logout',
to: uaa.serverUrl + '/api/logout',
redirect: 'permanent'
},
// {
// from: '^/logout',
// to: uaa.serverUrl + '/logout?redirect=http://localhost:9000',
// redirect: 'permanent'
// },
{
from: '^[^\.|]+$', //catch all client side routes
to: '/index.html'
Expand All @@ -93,7 +93,7 @@ module.exports = {
});
} else if (req.url.match('/userinfo')) {
if (uaa.hasValidSession()) {
res.end(JSON.stringify({email: uaa.user.email, user_name: uaa.user.name}));
res.end(JSON.stringify({email: uaa.user.email, user_name: uaa.user.username}));
} else {
next(401);
}
Expand Down

0 comments on commit 32cd37e

Please sign in to comment.