lucia-auth / lucia

Authentication, simple and clean
https://lucia-auth.com
MIT License
9.46k stars 485 forks source link

v3: Update database attributes type definition #1297

Closed pilcrowonpaper closed 10 months ago

pilcrowonpaper commented 10 months ago

Before

declare module "lucia" {
  interface Register {
    Lucia: typeof lucia;
    DatabaseSessionAttributes: {
      country: string;
    };
    DatabaseUserAttributes: {
      username: string;
    };
  }
}

After

declare module "lucia" {
  interface Register {
    Lucia: typeof lucia;
  }
  interface DatabaseSessionAttributes {
    country: string;
  };
  interface DatabaseUserAttributes {
    username: string;
  };
}
cloudflare-workers-and-pages[bot] commented 10 months ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: db91192
Status:🚫  Build failed.

View logs

sreeisalso commented 10 months ago

How about this change? I think it will be consistent

declare module "lucia" {
  interface Lucia {
    state: typeof lucia;
  }
  interface DatabaseSessionAttributes {
    country: string;
  };
  interface DatabaseUserAttributes {
    username: string;
  };
}
pilcrowonpaper commented 10 months ago

Won’t work since Lucia already exists @sreeisalso