An example app using Deno's Fresh framework and Supabase implementing the PKCE authentication scheme.
If you like the app, consider leaving me a star!
You need a Supabase account which you can create for
free. Create a .env
file in the project root containing the following
variables:
SUPABASE_URL=https://<projectName>.supabase.co
SUPABASE_ANON_KEY=<api_key>
Run the app:
deno task start
This will watch the project directory and restart as necessary.
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.