title: How to get authenticated user info with express based on JWT token
body: <p>Im new to express, before using express I spent a lot of time with laravel and PHP.</p>
  <p>So this is my problems, I have a schema database like this :</p>
  <p>Users table :</p>
  <pre><code>created_by
  updated_by
  </code></pre>
  <p>I want auto fill it with authenticated user id, with laravel I can write something like this</p>
  <pre><code>$new_user-&gt;request('created_by') = \Auth::user()-&gt;id; \\ this code will show or get the information of user who already authenticated
  </code></pre>
  <p>this is the result that I want :</p>
  <pre><code>updated_by = 1,
  created_by = 1
  </code></pre>
  <p>and how can I do that in express, how to get the authenticated user info???</p>
  <p>this is my syntax :</p>
  <pre><code>User.update(
      {
        username: req.body.username,
        name: req.body.name,
        email: req.body.email,
        status: req.body.status,
        phone: req.body.phone,
        keterangan: req.body.keterangan,
        role: req.body.role,
        password: bcrypt.hashSync(req.body.password, 8),
        created_by : // what should i write ?,
        updated_by : // what should i write ?,
      },
      {
        where: { id: id },
      }
    )
  </code></pre>
  <p>thanks for reading this, and sorry for my bad english.</p>