-
-
Notifications
You must be signed in to change notification settings - Fork 63
/
index.ts
38 lines (33 loc) · 1.07 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
* @adonisjs/auth
*
* (c) AdonisJS
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
export * as errors from './src/errors.js'
export { configure } from './configure.js'
export * as symbols from './src/symbols.js'
export { AuthManager } from './src/auth_manager.js'
export { defineConfig } from './src/define_config.js'
export { Authenticator } from './src/authenticator.js'
export { AuthenticatorClient } from './src/authenticator_client.js'
import type { withAuthFinder as withAuthFinderType } from './src/mixins/lucid.js'
function isModuleInstalled(moduleName: string) {
try {
import.meta.resolve(moduleName)
return true
} catch (e) {
return false
}
}
/**
* @deprecated Import `withAuthFinder` from `@adonisjs/auth/mixins/lucid` instead
*/
let withAuthFinder: typeof withAuthFinderType
if (isModuleInstalled('@adonisjs/lucid')) {
const { withAuthFinder: withAuthFinderFn } = await import('./src/mixins/lucid.js')
withAuthFinder = withAuthFinderFn
}
export { withAuthFinder }