This repository was archived by the owner on Sep 22, 2024. It is now read-only.
File tree 3 files changed +4
-6
lines changed
3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 1
- import { type FreshConfig } from "fresh/server.ts" ;
1
+ import type { FreshConfig } from "fresh/server.ts" ;
2
2
import type { LoaderState } from "netzo/plugins/loader/plugin.ts" ;
3
3
import type { MdxState } from "netzo/plugins/mdx/plugin.ts" ;
4
4
import type { AuthState } from "./plugins/auth/plugin.ts" ;
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ import {
12
12
setRequestState ,
13
13
setSessionState ,
14
14
} from "./middlewares/mod.ts" ;
15
- import createAuth from "./routes/auth.tsx" ;
15
+ import createRouteIndex from "./routes/auth.tsx" ;
16
16
import { getRoutesByProvider } from "./routes/mod.ts" ;
17
17
import { EmailAuthConfig } from "./utils/providers/email.ts" ;
18
18
import { NetzoAuthConfig } from "./utils/providers/netzo.ts" ;
@@ -150,7 +150,7 @@ export const auth = (config: AuthConfig): Plugin<NetzoState> => {
150
150
config . resolveUserData ??= ( user ) => user ?. data ?? { } ;
151
151
152
152
const authRoutes : PluginRoute [ ] = [
153
- { path : "/auth" , component : createAuth ( config ) } ,
153
+ { path : "/auth" , component : createRouteIndex ( config ) } ,
154
154
...Object . keys ( config . providers )
155
155
. filter ( ( provider ) => ! ! config ?. providers ?. [ provider as AuthProvider ] )
156
156
. flatMap ( ( provider ) => getRoutesByProvider ( provider as AuthProvider , config ) ) ,
Original file line number Diff line number Diff line change @@ -5,9 +5,7 @@ import type { Auth, AuthUser } from "./types.ts";
5
5
export const createDatabaseAuth = ( db : ReturnType < typeof database > ) : Auth => {
6
6
const { $users, $sessions } = db ?. _ ?. fullSchema ! ?? { } ; // use fullSchema, not schema
7
7
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` ) ;
11
9
12
10
return {
13
11
createUser : async ( user : AuthUser ) => {
You can’t perform that action at this time.
0 commit comments