Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Doha2012 committed Mar 16, 2016
1 parent ef2538d commit 453e617
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ public class UserController {
public Map<String, Object> getExtraInfo(OAuth2Authentication auth) {
final OAuth2AuthenticationDetails details = (OAuth2AuthenticationDetails) auth.getDetails();
final OAuth2AccessToken accessToken = tokenStore.readAccessToken(details.getTokenValue());
System.out.println(accessToken);
return accessToken.getAdditionalInformation();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,14 @@
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular-route.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/ngStorage/0.3.9/ngStorage.min.js"></script>

<script type="text/javascript" src="https://cdn.rawgit.com/auth0/angular-jwt/master/dist/angular-jwt.js"></script>

<script th:src="@{/resources/angular-utf8-base64.min.js}"></script>
<script>
/*<![CDATA[*/
var app = angular.module('myApp', ["ngResource","ngRoute","ngCookies"]);
var app = angular.module('myApp', ["ngResource","ngRoute","ngCookies","angular-jwt"]);

app.controller('mainCtrl', function($scope,$resource,$http,$httpParamSerializer,$cookies) {
app.controller('mainCtrl', function($scope,$resource,$http,$httpParamSerializer,$cookies,jwtHelper) {
$scope.foo = {id:0 , name:"sample foo"};
$scope.foos = $resource("http://localhost:8081/spring-security-oauth-resource/foos/:fooId",{fooId:'@id'});

Expand Down Expand Up @@ -77,11 +78,16 @@
}

function getOrganization(){
$http.get("http://localhost:8081/spring-security-oauth-resource/users/extra")
var token = $cookies.get("access_token");
var payload = jwtHelper.decodeToken(token);
console.log(payload);
$scope.organization = payload.organization;

/* $http.get("http://localhost:8081/spring-security-oauth-resource/users/extra")
.then(function(response) {
console.log(response);
$scope.organization = response.data.organization;
});
}); */
}

});
Expand Down

0 comments on commit 453e617

Please sign in to comment.