title: fastify-jwt sign token with user ID payload
body: <p>I'm making a simple sign-in function, that will return a token with the user's ID.</p>
  <p>I've registered the <code>fastify-jwt</code> on the <code>fastify</code> instance with the key
  and added user id in the call to the sign function.</p>
  <p>Code <strong>auth.js</strong></p>
  <pre><code>import Fastify from &quot;fastify&quot;;
  import fastifyJwt from &quot;fastify-jwt&quot;;
  import { users } from &quot;../dummy-data/users.js&quot;;
  
  const fastify = Fastify();
  const SECRET_KEY = &quot;secret&quot;;
  fastify.register(fastifyJwt, { secret: SECRET_KEY });
  
  ......
  
  const signIn = function (req, res) {
    const { email, password } = req.body;
    const foundUser = users.find(
      (user) =&gt; user.email === email &amp;&amp; user.password === password
    );
    const { id } = foundUser;
    const accessToken = fastify.jwt.sign({ id }, SECRET_KEY);
    res.status(200).send({ accessToken });
  }
  </code></pre>
  <p>but this does not work, it shows this error:</p>
  <p><strong>&quot;message&quot;: &quot;Expected &quot;options&quot; to be a plain object.&quot;</strong></p>
  <pre><code>{
    &quot;statusCode&quot;: 500,
    &quot;error&quot;: &quot;Internal Server Error&quot;,
    &quot;message&quot;: &quot;Expected \&quot;options\&quot; to be a plain object.&quot;
  }
  </code></pre>
  <p>anyone knows the correct approach?</p>