Pre-release
Pre-release

@tanner0101 tanner0101 released this May 9, 2018 · 18 commits to master since this 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 requireAuthenticated will always throw an error if User is not authed, regardless of the presence of GuardAuthenticationMiddleware.

Fixed:

  • Authenticatable protocols have had Model requirements removed. Free conformance still applies where Model conformance exists.
  • Crypto module is now being exported by default.

Milestone:
2.0.0-rc.4

Assets 2