lecture 5 of 170 completed

Authentication architecture at scale

storageState files, setup projects, several roles and token expiry. Auth design decides both runtime and reliability.

What you'll learn

  • How setup projects authenticate once per run
  • How to handle several roles and token expiry
  • Why a mutating test needs its own account

Six roles, two thousand tests, and a token that expires after thirty minutes while the suite runs for forty. This lecture is the architecture that handles all three.

The mechanism. storageState is a JSON file holding cookies and localStorage. Save it once, and any context can start from it already authenticated.

The setup project pattern, which is the piece that makes this scale:

members only

Keep reading with the full course

The Foundations track and the first 5 lectures of each framework are free. This lecture is part of the paid course, which unlocks every lecture, all three frameworks, and downloads.

See the options →