29 lines
		
	
	
		
			No EOL
		
	
	
		
			810 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
		
			No EOL
		
	
	
		
			810 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import { defineConfig } from '@adonisjs/auth'
 | |
| import { sessionGuard, sessionUserProvider } from '@adonisjs/auth/session'
 | |
| import type { InferAuthenticators, InferAuthEvents, Authenticators } from '@adonisjs/auth/types'
 | |
| 
 | |
| const authConfig = defineConfig({
 | |
|   default: 'web',
 | |
|   guards: {
 | |
|     web: sessionGuard({
 | |
|       useRememberMeTokens: true,
 | |
|       rememberMeTokensAge: '2 years',
 | |
|       provider: sessionUserProvider({
 | |
|         model: () => import('#models/user')
 | |
|       }),
 | |
|     }),
 | |
|   },
 | |
| })
 | |
| 
 | |
| export default authConfig
 | |
| 
 | |
| /**
 | |
|  * Inferring types from the configured auth
 | |
|  * guards.
 | |
|  */
 | |
| declare module '@adonisjs/auth/types' {
 | |
|   export interface Authenticators extends InferAuthenticators<typeof authConfig> {}
 | |
| }
 | |
| declare module '@adonisjs/core/types' {
 | |
|   interface EventsList extends InferAuthEvents<Authenticators> {}
 | |
| } | 
