stormpath / Turnstile

An authentication framework for Swift.
Apache License 2.0
165 stars 29 forks source link

AuthError.notAuthenticated after authenticating the user. #22

Closed theobouwman closed 7 years ago

theobouwman commented 7 years ago

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.

By code is here : https://github.com/theobouwman/auth-vapor

Thanks in advance.

edjiang commented 7 years ago

I can't see your code, but that seems about right =] Now you just need something to render a proper error page if someone is not authenticated!