Session ID in a Post Login Action

Overview

This article explains why the session ID is not always present in a post-login action Event object.

Applies To

  • Actions
  • Event object

Solution

The post-login event action property event.session is marked as optional, as confirmed in the following Auth0 documentation: Actions Triggers: post-login - Event Object. This means the property can be undefined or null.

The event.session.id is present for the Authorization Code Flow. Other flows, like the Resource Owner Password Flow (otherwise known as the Resource Owner Password Grant, or ROPG), will not have the session.