From 0ceafc866e30fdd6ef79441ca7793f2bdb63c7bf Mon Sep 17 00:00:00 2001 From: Tanner Nelson Date: Mon, 27 Mar 2017 17:07:53 +0100 Subject: [PATCH] remove extra auth folder --- auth/LoginRedirectMiddleware.md | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 auth/LoginRedirectMiddleware.md diff --git a/auth/LoginRedirectMiddleware.md b/auth/LoginRedirectMiddleware.md deleted file mode 100644 index 890118e0..00000000 --- a/auth/LoginRedirectMiddleware.md +++ /dev/null @@ -1,22 +0,0 @@ ---- -currentMenu: LoginRedirectMiddleware ---- - -# Login Redirect Middleware - -`LoginRedirectMiddleware` is a Middleware to be used when you want to create an automatic redirection from any routes when the user is not authenticated. Users that want to access to a protected route will be redirected to a single route. - -## Example -In your main.swift file: - -```swift -drop.grouped(LoginRedirectMiddleware(loginRoute: "/login")).group("admin") { routeAdmin in - let imagesViewController = ImagesViewController() - routeAdmin.get("images", handler: imagesViewController.indexView) - routeAdmin.get("images", Image.self, handler: imagesViewController.imageSelectedView) - - } -``` - -> If the user is not connected when GET /admin/images is requested, user-agent will be redirected automatically to `/login` route -