Forum Discussion

mayank's avatar
11 years ago

how can i check login user id

 <#assign aUser=rest("/users/id/${user.id}").value/>
   <span>${aUser} </span>

 

 

 <#assign aUser=rest("/users/id/${user.id}").user/>
   <span>${aUser} </span>

 

Both not working...i want to fetch login user id in free marker language..

  • NicoB's avatar
    NicoB
    Lithium Alumni (Retired)

    Hi @mayank,
    what happens if you output ${aUser.login} (for example}
    aUser is an object so I wouldn't expect Freemarker to print anything about that object.

    Nico

    • mayank's avatar
      mayank
      Ace

      Can you please tell me how to print user id...in free markup language..

      • NicoB's avatar
        NicoB
        Lithium Alumni (Retired)
        Hi @mayank,
        I'm not too sure what you mean by "print" but if you write ${aUser.id} it will put the user id in the generated html.
        Another option would be :
        ${user.id} which gives you the ID of the currently logged in user.