How to get id of the current user logged in grails?

前端 未结 3 916
失恋的感觉
失恋的感觉 2021-01-18 18:24

I want to display the info about the user logged in like his details etc given during sign up ...how to do it ?? As iam new to grails plz help! iam using Spring security plu

3条回答
  •  野的像风
    2021-01-18 19:07

    add this @the top of your service or controller class

    def securityService
    

    this returns the cuureent user id.

    securityService.currentUser.id 
    

提交回复
热议问题