From 51174665297a31f3d64595a36bfe927bd69a955d Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Fri, 25 Aug 2017 09:20:50 +0200 Subject: [PATCH] If user is already authenticated, skip following auth filters. --- modules/auth/cms_auth_filter_i.e | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/modules/auth/cms_auth_filter_i.e b/modules/auth/cms_auth_filter_i.e index 21f566e..09f1ef9 100644 --- a/modules/auth/cms_auth_filter_i.e +++ b/modules/auth/cms_auth_filter_i.e @@ -10,6 +10,9 @@ deferred class inherit WSF_FILTER + rename + execute as auth_execute + end feature {NONE} -- Initialization @@ -25,8 +28,22 @@ feature -- API Service feature -- Basic operations + auth_execute (req: WSF_REQUEST; res: WSF_RESPONSE) + -- + do + -- If user is already authenticated, do not try current authenticating filter + -- and go to next filter directly. + if api.user_is_authenticated then + execute_next (req, res) + else + execute (req, res) + end + end + execute (req: WSF_REQUEST; res: WSF_RESPONSE) -- + require + no_user_authenticated: api.user = Void deferred end