Auth 2.0.0 RC 4
Pre-release
Pre-release
New:
- Added
GuardAuthenticationMiddleware. Authentication middlewares will no longer fail if they cannot authenticate a user. This allows the package's middlewares to be composed together to do multiple authentication types on a single route.
Use Authenticatable.guardAuthMiddleware() to restore this error throwing behavior.
let protected = router.grouped(
User.basicAuthMiddleware(...),
User.guardAuthMiddleware()
)
protected.get("test") { req in
return "This route is protected"
}note: calling
requireAuthenticatedwill always throw an error ifUseris not authed, regardless of the presence ofGuardAuthenticationMiddleware.
Fixed:
Authenticatableprotocols have hadModelrequirements removed. Free conformance still applies whereModelconformance exists.Cryptomodule is now being exported by default.
Milestone:
2.0.0-rc.4