https://github.com/morlinbrot/supa-fresh-pkce
Example app implementing the PKCE authentication scheme with Deno's Fresh and Supabase
https://github.com/morlinbrot/supa-fresh-pkce
auth deno deno-fresh pkce supabase
Last synced: 4 months ago
JSON representation
Example app implementing the PKCE authentication scheme with Deno's Fresh and Supabase
- Host: GitHub
- URL: https://github.com/morlinbrot/supa-fresh-pkce
- Owner: morlinbrot
- Created: 2023-12-05T17:18:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-14T21:59:47.000Z (over 1 year ago)
- Last Synced: 2026-02-15T06:25:42.274Z (4 months ago)
- Topics: auth, deno, deno-fresh, pkce, supabase
- Language: TypeScript
- Homepage:
- Size: 61.5 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Supa Fresh PKCE
An example app using Deno's [Fresh](https://fresh.deno.dev/) framework and
[Supabase](https://supabase.com/) implementing the PKCE authentication scheme.
If you like the app, consider leaving me a star!
[](https://github.com/morlinbrot/supa-fresh-pkce)
## Usage
You need a [Supabase account](https://supabase.com/) which you can create for
free. Create a `.env` file in the project root containing the following
variables:
```txt
SUPABASE_URL=https://.supabase.co
SUPABASE_ANON_KEY=
```
Run the app:
```shell
deno task start
```
This will watch the project directory and restart as necessary.
## Server Messages with Deno Kv
An interesting tidbit about this app is that it uses Deno Kv to "pass" messages
from API endpoints to route handlers which is a good example for the usefulness
and simplicity of Deno Kv. Since there is no (elegant) way of passing values
through a redirect, we store a message in the kv store, attach its id as search
parameter, parse the id in a middleware and then attach the message back into
the `FreshContext`. This way, message value can be arbitrarily complex and may
also contain sensitive information.