November 2018
Intermediate to advanced
404 pages
10h 16m
English
For completeness, you can finish the handler for the logout route.
Add the following logout handler function:
func logout(_ req: Request) throws -> Response { // no async call try req.unauthenticateSession(Admin.self) return req.redirect(to: self.mainPage)}
The logout handler simply calls the .unauthenticateSession() provided in the sessionAuthenticatable protocol to exit the current session.
Read now
Unlock full access