title: Check if User is Logged in on Firebase Auth from Node.js (Cloud Functions)
body: <p>I am trying to create an Express dynamic web page on Node.js. I want to perform the following logic on the server (Firebase Cloud Functions) at path <code>/</code>:</p>
  
  <ul>
  <li>If the client is logged in (Firebase Auth), render the home page <code>my_home_page.html</code></li>
  <li>If the client is not logged in, render the login page <code>my_login_page.html</code></li>
  </ul>
  
  <p>So I need to implement the <code>isClientLoggedIn</code> function:</p>
  
  <pre><code>import * as functions from 'firebase-functions';
  import * as express from 'express';
  
  const app = express();
  
  export const redirects = functions.https.onRequest(app);
  
  app.set('views', './res');
  app.engine('html', require('ejs').renderFile);
  app.set('view engine', 'html');
  
  function isClientLoggedIn(request: Request): bool {
      return // ???
  }
  app.get('/', (req, res) =&gt; {
      if (isClientLoggedIn(req)) {
          res.render('my_home_page.html');
      } else {
          res.render('my_login_page.html');
      }
  });
  </code></pre>
  
  <p>However, I have checked the Firebase Auth documentation and I do not know how to implement this function. Is it possible to check the clients' login state from the HTTP request, or are there other ways to render the correct content?</p>