Add middleware and logic for bootstrapping the session auth
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-06-05 13:24:12 -05:00
parent 91abcdf8ef
commit f00233d49a
14 changed files with 201 additions and 9 deletions

25
src/auth/config.ts Normal file
View File

@@ -0,0 +1,25 @@
import {Instantiable} from '../di'
import {ORMUserRepository} from './orm/ORMUserRepository'
/**
* Inferface for type-checking the AuthenticatableRepositories values.
*/
export interface AuthenticatableRepositoryMapping {
orm: Instantiable<ORMUserRepository>,
}
/**
* String mapping of AuthenticatableRepository implementations.
*/
export const AuthenticatableRepositories: AuthenticatableRepositoryMapping = {
orm: ORMUserRepository,
}
/**
* Interface for making the auth config type-safe.
*/
export interface AuthConfig {
repositories: {
session: keyof AuthenticatableRepositoryMapping,
}
}