parseOptionalAuth(ctx: Context): Promise<string | null>
Returns the caller's user id on a route open to anonymous callers, or null
when the request has no token. A placeholder such as Bearer undefined
counts as no token. An invalid token throws instead of reading as anonymous,
so that a stale session gets a 401 the client signs out on, rather than a
misleading 404 on a private resource.