Skip to content

cotyhamilton/lucia-auth-adapter-deno-kv

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lucia auth adapter deno kv

JSR

compatible with npm:lucia@3

example implementation: https://github.com/cotyhamilton/deno-auth-lucia

usage

deno add @cotyhamilton/lucia-adapter-denokv
deno add npm:lucia@3
import { Lucia } from "lucia";
import { DenoKVAdapter } from "@cotyhamilton/lucia-adapter-denokv";

const kv = await Deno.openKv();

export const lucia = new Lucia(new DenoKVAdapter(kv), {
  getUserAttributes: (attributes) => {
    return {
      // attributes has the type of DatabaseUserAttributes
      name: attributes.name,
    };
  },
});

declare module "lucia" {
  interface Register {
    Lucia: typeof lucia;
    DatabaseUserAttributes: DatabaseUserAttributes;
  }
}

interface DatabaseUserAttributes {
  name: string;
}

reference

About

lucia adapter for deno kv on deno

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published