morlinbrot / supa-fresh-pkce

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


Languages

Language:TypeScript 98.9%Language:Just 0.9%Language:CSS 0.2%