title: Using 'nestjs/jwt' signing with dynamic/user-related secret
body: <p>I'm trying to create a user token based on the secret of the user trying to log in. However instead of using a secret from the environment I want to use a secret assigned to a user object inside the database.</p>
  
  <pre><code>import { Injectable } from '@nestjs/common';
  import { JwtService } from '@nestjs/jwt';
  import { UserService } from '@src/modules/user/services';
  
  @Injectable()
  export class AuthService {
    public constructor(private readonly jwtService: JwtService,
                       private readonly userService: UserService) {}
  
    public async createToken(email: string): Promise&lt;JwtReply&gt; {
      const expiresIn = 60 * 60 * 24;
      const user = await this.userService.user({ where: { email } });
      const accessToken = await this.jwtService.signAsync({ email: user.email },
                                                          /* user.secret ,*/
                                                          { expiresIn });
  
      return {
        accessToken,
        expiresIn,
      };
    }
  }
  </code></pre>
  
  <p>I'm new to Nestjs and maybe I'm missing something. 
  <a href="https://github.com/auth0/node-jsonwebtoken#jwtsignpayload-secretorprivatekey-options-callback" rel="noreferrer">node-jsonwebtoken</a> does provide the necessary parameter in the <code>sign(...)</code> function. <code>nestjs/jwt</code> is missing this parameter (see code). How would you solve it without using <code>node-jsonwebtoken</code> or maybe a more abstract question: does my way of handling user secret make sense here? Thanks.</p>