code: def encode_token(self, token):
          
          key = current_app.secret_key
          if key is None:
              raise RuntimeError(
                  "please set app.secret_key before generate token")
          return jwt.encode(token, key, algorithm=self.config["algorithm"])
docs: Encode Authorization token, return bytes token