Skip to content
This repository has been archived by the owner on Sep 22, 2024. It is now read-only.

Commit

Permalink
chore(auth): remove legacy datastore adapter in favor of a single `…
Browse files Browse the repository at this point in the history
…database` adapter
  • Loading branch information
miguelrk committed Jun 25, 2024
1 parent 33cebfd commit 79a6201
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 90 deletions.
14 changes: 6 additions & 8 deletions deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,13 @@
"@/": "./",
"netzo/": "./lib/",
"fresh/": "https://deno.land/x/[email protected]/",
"preact": "https://esm.sh/[email protected]",
"preact/": "https://esm.sh/[email protected]/",
"@preact/signals": "https://esm.sh/*@preact/[email protected]",
"@preact/signals-core": "https://esm.sh/*@preact/[email protected]",
"react": "https://esm.sh/[email protected]/compat",
"react-dom": "https://esm.sh/[email protected]/compat",
"preact": "npm:[email protected]",
"react": "npm:[email protected]/compat",
"react-dom": "npm:[email protected]/compat",
"@preact/signals": "npm:@preact/[email protected]",
"@preact/signals-core": "npm:@preact/[email protected]",
"std/": "https://deno.land/[email protected]/",
"react/jsx-runtime": "https://esm.sh/[email protected]/compat",
"zod": "https://deno.land/x/[email protected]/mod.ts",
"drizzle-orm": "npm:[email protected]",
"deno_kv_oauth/": "https://deno.land/x/[email protected]/"
}
}
6 changes: 3 additions & 3 deletions lib/plugins/auth/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import type { FreshContext, Plugin, PluginRoute } from "fresh/server.ts";
import { HTMLAttributes } from "preact/compat";
import type { NetzoState } from "../../mod.ts";
import {
NetzoStateWithAuth,
assertUserIsMemberOfWorkspaceOfApiKeyIfProviderIsNetzo,
createAssertUserIsAuthorized,
createAuthState,
ensureSignedIn,
NetzoStateWithAuth,
setRequestState,
setSessionState,
} from "./middlewares/mod.ts";
Expand All @@ -18,8 +18,8 @@ import type { Auth, AuthProvider, AuthUser } from "./utils/types.ts";

export * from "../../deps/deno_kv_oauth/mod.ts";

export * from "./utils/adapters/database.ts";
export * from "./utils/adapters/datastore.ts";
export * from "./utils/adapter.ts";
export * from "./utils/schema.ts";

type AuthConfigProvider = {
/** Whether to allow signups for new users (defaults to true). */
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { eq } from "drizzle-orm";
import { database, id } from "../../../../database/mod.ts";
import type { Auth, AuthUser } from "../types.ts";

export * from "./database.schema.ts";
import { database, id } from "../../../database/mod.ts";
import type { Auth, AuthUser } from "./types.ts";

export const createDatabaseAuth = (db: ReturnType<typeof database>): Auth => {
const { $users, $sessions } = db?._?.fullSchema! ?? {}; // use fullSchema, not schema
Expand Down
75 changes: 0 additions & 75 deletions lib/plugins/auth/utils/adapters/datastore.ts

This file was deleted.

0 comments on commit 79a6201

Please sign in to comment.