Skip to content

Example app implementing the PKCE authentication scheme with Deno's Fresh and Supabase

Notifications You must be signed in to change notification settings

morlinbrot/supa-fresh-pkce

Repository files navigation

Supa Fresh PKCE

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!

Github Repo Stars

Usage

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.

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.

About

Example app implementing the PKCE authentication scheme with Deno's Fresh and Supabase

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages