I'm using the Vapor framework for Swift.
And I can successful register and log users in. But when I add a custom Authentication middleware to a route where only Authenticated users should go, it gives me this response :
Uncaught Error: AuthError.notAuthenticated. Use middleware to catch this error and provide a better response. Otherwise, a 500 error page will be returned in the production environment.
I'm using the Vapor framework for Swift. And I can successful register and log users in. But when I add a custom Authentication middleware to a route where only Authenticated users should go, it gives me this response :
By code is here : https://github.com/theobouwman/auth-vapor
Thanks in advance.