Skip to content

You're viewing documentation for a pre-release version. View the latest stable version

Instance Method

require(_:)

Look up an instance of the supplied type, treating it as an error if there is no such instance.
@discardableResult func require<A>(_ type: A.Type = A.self) throws(Abort) -> A where A : Authenticatable

Parameters

type

The authenticatable type to look up

Return Value

An instance of the requested type, if one exists

Discussion

Throws

Abort(.unauthorized) if no instance of the requested type is available