Skip to content

examples: provider auth in SSR and SPA for Auth0, Apple, Microsoft and Google #32

Open

Description

@smiggleworth

Goal

Runnable examples proving provider auth "just works" in both SSR and SPA modes for Auth0, Apple, Microsoft and Google, built on askr-server provider sign-in (askrjs/askr-server#76) and the askr router binding (askrjs/askr#777). These replace the browser-session examples being removed from askr-auth (askrjs/askr-auth#65).

Requirements

  • One example app (or one per provider, whichever is clearer) using the first-party Vite+ toolchain, runnable in SSR and SPA modes.
  • Each provider shows: setup, sign-in, callback, reload restoration, protected route redirect with next, session expiry/renewal or interactive recovery, local logout (plus provider logout where supported), and error states.
  • API access from server actions only: Microsoft Graph (one call), a Google API after separate consent (one call), and an Auth0 API audience (one call). Apple shows the real server exchange boundary and first-login profile handling.
  • No tokens or secrets in the browser, the repo or the README. Configuration comes from environment variables, with setup instructions that match askr add auth output.
  • Local HTTPS / tunnel instructions, including Apple's no-localhost constraint.
  • A simulated-provider mode so CI can run every example without live credentials.

Acceptance criteria

Depends on askrjs/askr-server#76 and askrjs/askr#777 and the provider presets. Part of askrjs/askr-auth#64.

Activity

  1. added this to the 0.5.0 milestone on Oct 10, 2026
  2. smiggleworth commented on Oct 13, 2026

    @smiggleworth
    ContributorAuthor

    The implementation is in #34 at 06cbac9461490f3b0dab55d42943818c94734b6e, including the real private-session-expiry repair: an active private-query 401 clears authenticated/protected state and starts provider recovery; aborted requests do not trigger that transition. The native Google SPA regression reproduced stale private content before the repair and passes afterward.

    Local simulated-provider coverage passed across SSR/SPA and Chromium, Firefox, and WebKit (54 browser cases), alongside the workspace checks and builds. This is local candidate-graph evidence. Hosted run 38386007906 fails before compilation/tests because public npm cannot install the unpublished @askrjs/vite@0.5.0 archive. No publication or normal public-registry acceptance is claimed.

    Keep this issue open until #34 passes ordinary hosted acceptance and lands on develop. Live provider-account qualification remains deferred as recorded in askr-auth#71; simulated providers do not establish live compatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions