File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -30,9 +30,25 @@ export default defineNuxtModule<ModuleOptions>({
30
30
addImportsDir ( resolver . resolve ( './runtime/composables' ) )
31
31
addPlugin ( resolver . resolve ( './runtime/plugins/session.server' ) )
32
32
// Server
33
- nuxt . options . nitro . imports = nuxt . options . nitro . imports || { }
34
- nuxt . options . nitro . imports . dirs = nuxt . options . nitro . imports . dirs || [ ]
35
- nuxt . options . nitro . imports . dirs . push ( resolver . resolve ( './runtime/server/utils' ) )
33
+ if ( nuxt . options . nitro . imports !== false ) {
34
+ nuxt . options . nitro . imports = defu ( nuxt . options . nitro . imports , {
35
+ presets : [
36
+ {
37
+ from : resolver . resolve ( './runtime/server/utils/oauth' ) ,
38
+ imports : [ 'oauth' ]
39
+ } ,
40
+ {
41
+ from : resolver . resolve ( './runtime/server/utils/session' ) ,
42
+ imports : [
43
+ 'getUserSession' ,
44
+ 'setUserSession' ,
45
+ 'clearUserSession' ,
46
+ 'requireUserSession' ,
47
+ ]
48
+ }
49
+ ]
50
+ } )
51
+ }
36
52
// Waiting for https://github.com/nuxt/nuxt/pull/24000/files
37
53
// addServerImportsDir(resolver.resolve('./runtime/server/utils'))
38
54
addServerHandler ( {
You can’t perform that action at this time.
0 commit comments