Anonymous sessions work with row-level security policies
Tokens from anonymous and regular sign-ins now carry the authenticated role, so policies that check the JWT role match them.
What's new
Signed-in users, anonymous ones included, carry the authenticated role. Realm tokens have no role claim, so a policy that reads auth.jwt() ->> 'role' saw NULL. The API now sets the claim to authenticated when the token has none, and keeps a role the realm already set.
Anonymous tokens keep is_anonymous: true and the user's id in auth.uid(), so policies can still tell them apart.