File tree Expand file tree Collapse file tree
runtime/server/composables Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -81,10 +81,17 @@ export default defineNuxtModule<ModuleOptions>({
8181 const canPrompt = nuxt . options . dev
8282
8383 // Transpile edgedb
84- nuxt . options . build = nuxt . options . build ?? { }
84+ nuxt . options . build ??= { }
8585 nuxt . options . build . transpile ??= [ ]
8686 nuxt . options . build . transpile . push ( 'edgedb' )
8787
88+ // Set user model if `auth` is set.
89+ nuxt . options . runtimeConfig ??= { }
90+ nuxt . options . runtimeConfig . edgeDb ??= {
91+ auth : options . auth ,
92+ identityModel : options . identityModel ,
93+ }
94+
8895 async function piped$ (
8996 command : string ,
9097 args : string [ ] ,
Original file line number Diff line number Diff line change 1+ import { useRuntimeConfig } from '#imports'
2+
13export function useEdgeDbEnv ( ) {
4+ const { edgeDb } = useRuntimeConfig ( )
5+
26 const {
37 APP_URL : appUrl ,
48 NUXT_EDGEDB_HOST : host ,
@@ -40,5 +44,7 @@ export function useEdgeDbEnv() {
4044 port,
4145 tlsCA,
4246 tlsSecurity : tlsSecurity as 'insecure' | 'no_host_verification' | 'strict' | 'default' ,
47+ auth : edgeDb ?. auth || false ,
48+ identityModel : edgeDb ?. identityModel || 'User' ,
4349 }
4450}
You can’t perform that action at this time.
0 commit comments