chore: init adonis

This commit is contained in:
Sonny
2024-04-27 15:49:47 +02:00
committed by Sonny
parent 219e5e3aed
commit 1386db6935
259 changed files with 7184 additions and 18173 deletions

28
config/auth.ts Normal file
View File

@@ -0,0 +1,28 @@
import { defineConfig } from '@adonisjs/auth';
import { InferAuthEvents, Authenticators } from '@adonisjs/auth/types';
import { sessionGuard, sessionUserProvider } from '@adonisjs/auth/session';
const authConfig = defineConfig({
default: 'web',
guards: {
web: sessionGuard({
useRememberMeTokens: false,
provider: sessionUserProvider({
model: () => import('#models/user'),
}),
}),
},
});
export default authConfig;
/**
* Inferring types from the configured auth
* guards.
*/
declare module '@adonisjs/auth/types' {
interface Authenticators extends InferAuthenticators<typeof authConfig> {}
}
declare module '@adonisjs/core/types' {
interface EventsList extends InferAuthEvents<Authenticators> {}
}