protected-page-token-warmup

Defer bearer token refresh until required by API actions.

1|Updated Dec 23, 2025
One-click install
npx skills add https://github.com/jonnymuir/Umbraco.Prism --skill protected-page-token-warmup
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: protected-page-token-warmup
Source: https://github.com/jonnymuir/Umbraco.Prism/tree/main/.claude/skills/protected-page-token-warmup
Command: npx skills add https://github.com/jonnymuir/Umbraco.Prism --skill protected-page-token-warmup

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill prevents unnecessary redirect loops and authentication churn by ensuring that downstream token refresh operations are only triggered when an API or action explicitly requires a bearer token, rather than during initial page rendering.

Core Features & Use Cases

  • Deferred Token Refresh: Decouples page rendering from token acquisition to improve reliability.
  • Auth-Loop Prevention: Eliminates common redirect loops caused by eager cookie renewal during server-side rendering.
  • Use Case: When building protected dashboards in Umbraco, use this pattern to ensure the dashboard renders immediately while deferring bearer token retrieval to the specific service calls that need it.

Quick Start

Apply the protected-page-token-warmup pattern by removing token-refresh logic from your controller's initial render method and moving it into the specific downstream API actions.

Frequently Asked Questions about protected-page-token-warmup

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
Why do authentication redirect loops happen during server-side rendering of protected pages?

Authentication redirect loops happen when eager cookie renewal or token warming triggers repeated redirects before the page renders. Deferring downstream token refresh operations until an API action explicitly requires a bearer token eliminates this churn.

How do I stop auth-cookie refresh from blocking page rendering in Umbraco?

To stop auth-cookie refresh from blocking rendering, separate page rendering logic from bearer token acquisition by removing token-refresh logic from the controller's initial render method and moving it into downstream API actions.

When should I defer bearer token retrieval in a server-rendered web application?

You should defer bearer token retrieval when eager token warming causes performance degradation or redirect loops. This pattern applies to server-rendered apps where protected pages must render immediately without waiting for downstream token refresh operations.

Does deferring token refresh to API actions work for protected Umbraco dashboards?

Yes, deferring token refresh works for protected Umbraco dashboards by allowing the dashboard to render immediately while bearer token retrieval is handled by the specific service calls that actually need it.

What's the best way to decouple page rendering from token acquisition in middleware?

The best way to decouple rendering from token acquisition is to architecturally separate page rendering logic from bearer token acquisition processes, ensuring token refresh middleware only triggers when API actions explicitly require authentication.

Can eager token warming cause performance issues in server-rendered authentication flows?

Yes, eager token warming causes performance degradation in server-rendered authentication flows by triggering unnecessary downstream token refresh operations during initial page rendering instead of waiting until API actions require them.