title: How to fix 'TypeError: Cannot read property 'keycloak-token' of undefined' error in javascript?
body: <p>I'm trying to use keycloak in my node project but I'm always getting the following message : Cannot read property 'keycloak-token' of undefined.</p>
  
  <p>Before that, I've launched keycloak, I created a new realm 'Test' and a new user 'id_a' which for I've set a new password. I can access to the account with keycloak but I can't with my code. Can you please help me ?</p>
  
  <pre><code>var session = require('express-session');
  var Keycloak = require('keycloak-connect');
  const express = require('express');
  
  var memoryStore = new session.MemoryStore();
  
  let kcConfig = {
    clientId: "id_a",
    bearerOnly: true,
    serverUrl: 'http://localhost:8080/auth',
    realm: 'Test'
  };
  
  let keycloak = new Keycloak({ store: memoryStore }, kcConfig);
  
  var app = express();
  
  app.use( keycloak.middleware() );
  
  app.get( '/complain', keycloak.protect(), function(req, res) {
    res.send('hello world');
  });
  
  app.listen(3001, function(){
    console.log('Server started on port 3001...')
  });
  </code></pre>
  
  <p>the output is : 'TypeError: Cannot read property 'keycloak-token' of undefined' and I expect hello world</p>