Instance Propertyhummingbird-auth 2.0.2HummingbirdAuth
users
User repository
let users: Repository
User repository
let users: Repository
import HummingbirdAuth
struct SessionAuthenticator<Context, Repository> where Context : AuthRequestContext, Context : SessionRequestContext, Repository : UserSessionRepository, Context.Identity == Repository.User, Context.Session == Repository.Identifier
Session authenticator
init<Session>(context: Context.Type = Context.self, getUser: @escaping (Session, UserRepositoryContext) async throws -> Context.Identity?) where Repository == UserSessionClosureRepository<Session, Context.Identity>, Session == Context.Session
Initialize SessionAuthenticator middleware
init(users: Repository, context: Context.Type = Context.self)
Initialize SessionAuthenticator middleware
func authenticate(request: Request, context: Context) async throws -> Repository.User?
typealias Identity = Context.Identity