Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

docs: update anonymous sign-ins guide (#22321)

Kang Ming91921ee7caa3
diff --git a/apps/docs/content/guides/auth/auth-anonymous.mdx b/apps/docs/content/guides/auth/auth-anonymous.mdx
index b4f902eae1f..acc247ce8f0 100644
--- a/apps/docs/content/guides/auth/auth-anonymous.mdx
+++ b/apps/docs/content/guides/auth/auth-anonymous.mdx
@@ -22,7 +22,7 @@ This is different from the `anon` API key which does not create a user and can b
</Admonition>
-To get started, [enable anonymous sign-ins](/dashboard/project/_/auth/providers) for your Supabase Project.
+To get started, [enable anonymous sign-ins](/dashboard/project/_/settings/auth) for your Supabase Project.
<Admonition type="caution">
@@ -108,7 +108,7 @@ An anonymous user assumes the `authenticated` role just like a permanent user. Y
```sql
create policy "Only permanent users can post to the news feed"
-on news_feed for insert
+on news_feed as restrictive for insert
to authenticated
with check ((auth.jwt()->>'is_anonymous')::boolean is false );
@@ -118,6 +118,12 @@ to authenticated
using ( true );
```
+<Admonition variant="note" label="Use restrictive policies">
+
+RLS policies are permissive by default, which means that they are combined using an "OR" operator when multiple policies are applied. It is important to construct restrictive policies to ensure that the checks for an anonymous user are always enforced when combined with other policies.
+
+</Admonition>
+
## Resolving identity conflicts
Depending on your application requirements, data conflicts can arise when an anonymous user is converted to a permanent user. For example, in the context of an e-commerce application, an anonymous user would be allowed to add items to the shopping cart without signing up / signing in. When they decide to sign-in to an existing account, you will need to decide how you want to resolve data conflicts in the shopping cart: