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

Commit 9984d51

Browse files
committed
chore: updates
1 parent 52555d3 commit 9984d51

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

Diff for: lib/mod.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { type FreshConfig } from "fresh/server.ts";
1+
import type { FreshConfig } from "fresh/server.ts";
22
import type { LoaderState } from "netzo/plugins/loader/plugin.ts";
33
import type { MdxState } from "netzo/plugins/mdx/plugin.ts";
44
import type { AuthState } from "./plugins/auth/plugin.ts";

Diff for: lib/plugins/auth/plugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
setRequestState,
1313
setSessionState,
1414
} from "./middlewares/mod.ts";
15-
import createAuth from "./routes/auth.tsx";
15+
import createRouteIndex from "./routes/auth.tsx";
1616
import { getRoutesByProvider } from "./routes/mod.ts";
1717
import { EmailAuthConfig } from "./utils/providers/email.ts";
1818
import { NetzoAuthConfig } from "./utils/providers/netzo.ts";
@@ -150,7 +150,7 @@ export const auth = (config: AuthConfig): Plugin<NetzoState> => {
150150
config.resolveUserData ??= (user) => user?.data ?? {};
151151

152152
const authRoutes: PluginRoute[] = [
153-
{ path: "/auth", component: createAuth(config) },
153+
{ path: "/auth", component: createRouteIndex(config) },
154154
...Object.keys(config.providers)
155155
.filter((provider) => !!config?.providers?.[provider as AuthProvider])
156156
.flatMap((provider) => getRoutesByProvider(provider as AuthProvider, config)),

Diff for: lib/plugins/auth/utils/adapter.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@ import type { Auth, AuthUser } from "./types.ts";
55
export const createDatabaseAuth = (db: ReturnType<typeof database>): Auth => {
66
const { $users, $sessions } = db?._?.fullSchema! ?? {}; // use fullSchema, not schema
77
if (!$users) throw new Error(`Missing "$users" table in database schema`);
8-
if (!$sessions) {
9-
throw new Error(`Missing "$sessions" table in database schema`);
10-
}
8+
if (!$sessions) throw new Error(`Missing "$sessions" table in database schema`);
119

1210
return {
1311
createUser: async (user: AuthUser) => {

0 commit comments

Comments
 (0)