Skip to content

Commit 1cb8277

Browse files
authored
docs: add warning about supabase auth security issue (#319)
* docs: add warning about supabase auth security issue * update * update
1 parent 785ca56 commit 1cb8277

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/guides/authentication/supabase.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ async function getPrisma() {
9191
}
9292
```
9393

94+
:::warning
95+
96+
It may be tempting to call Supabase's `getSession` API to get the current user. However, the data returned is not validated on the server side, so it should not be trusted. You can find more details in [this GitHub discussion](https://github.com/orgs/supabase/discussions/23224). Calling `getUser` instead guarantees that the return user identity is validated remotely, although it incurs an extra network request to Supabase. Supabase may resolve the performance issue in the future.
97+
98+
Special thanks to [@bbozzay](https://github.com/bbozzay) for bringing this issue to our attention!
99+
100+
:::
101+
94102
You can then use this enhanced Prisma client for CRUD operations that you desire to be governed by the access policies you defined in your data models.
95103

96104
Next, make sure to read [this guide](../supabase-security) to ensure your database is securely protected from HTTP requests to the supabase API.

0 commit comments

Comments
 (0)