{"action":"created","issue":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1730","labels_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1730/labels{/name}","comments_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1730/comments","events_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1730/events","html_url":"https://github.com/jhipster/generator-jhipster/issues/1730","id":95162118,"number":1730,"title":"Improvement to get current user id","user":{"login":"gzsombor","id":66230,"avatar_url":"https://avatars.githubusercontent.com/u/66230?v=3","gravatar_id":"","url":"https://api.github.com/users/gzsombor","html_url":"https://github.com/gzsombor","followers_url":"https://api.github.com/users/gzsombor/followers","following_url":"https://api.github.com/users/gzsombor/following{/other_user}","gists_url":"https://api.github.com/users/gzsombor/gists{/gist_id}","starred_url":"https://api.github.com/users/gzsombor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gzsombor/subscriptions","organizations_url":"https://api.github.com/users/gzsombor/orgs","repos_url":"https://api.github.com/users/gzsombor/repos","events_url":"https://api.github.com/users/gzsombor/events{/privacy}","received_events_url":"https://api.github.com/users/gzsombor/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jhipster/generator-jhipster/labels/feature%20request","name":"feature request","color":"0052cc"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-07-15T10:45:49Z","updated_at":"2015-10-10T09:03:54Z","closed_at":null,"body":"From my experiences, it is a generic need to get the id of the current user, not only the login name. It would be more efficient, and it would eliminate lot's of unnecessary db calls, for the login name -> id conversions. If others have the same experience - I would like to propose to add a : \r\n* Create a new class which org.springframework.security.core.userdetails.UserDetails, which stores the user id too \r\n* Modify the UserDetailsService to return that new User object\r\n* Add a new method into  SecurityUtils, named as  getCurrentLoginId() to get the user id from spring security context\r\n\r\nWhat do you think?"},"comment":{"url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/comments/147067188","html_url":"https://github.com/jhipster/generator-jhipster/issues/1730#issuecomment-147067188","issue_url":"https://api.github.com/repos/jhipster/generator-jhipster/issues/1730","id":147067188,"user":{"login":"gzsombor","id":66230,"avatar_url":"https://avatars.githubusercontent.com/u/66230?v=3","gravatar_id":"","url":"https://api.github.com/users/gzsombor","html_url":"https://github.com/gzsombor","followers_url":"https://api.github.com/users/gzsombor/followers","following_url":"https://api.github.com/users/gzsombor/following{/other_user}","gists_url":"https://api.github.com/users/gzsombor/gists{/gist_id}","starred_url":"https://api.github.com/users/gzsombor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gzsombor/subscriptions","organizations_url":"https://api.github.com/users/gzsombor/orgs","repos_url":"https://api.github.com/users/gzsombor/repos","events_url":"https://api.github.com/users/gzsombor/events{/privacy}","received_events_url":"https://api.github.com/users/gzsombor/received_events","type":"User","site_admin":false},"created_at":"2015-10-10T09:03:54Z","updated_at":"2015-10-10T09:03:54Z","body":"Yes, that entity class is managed by hibernate, and if you put that class into the http session, as spring will do it - bad things will happen. "}}