If user is already authenticated, skip following auth filters.
This commit is contained in:
@@ -10,6 +10,9 @@ deferred class
|
|||||||
|
|
||||||
inherit
|
inherit
|
||||||
WSF_FILTER
|
WSF_FILTER
|
||||||
|
rename
|
||||||
|
execute as auth_execute
|
||||||
|
end
|
||||||
|
|
||||||
feature {NONE} -- Initialization
|
feature {NONE} -- Initialization
|
||||||
|
|
||||||
@@ -25,8 +28,22 @@ feature -- API Service
|
|||||||
|
|
||||||
feature -- Basic operations
|
feature -- Basic operations
|
||||||
|
|
||||||
|
auth_execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
|
-- <Precursor>
|
||||||
|
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)
|
execute (req: WSF_REQUEST; res: WSF_RESPONSE)
|
||||||
-- <Precursor>
|
-- <Precursor>
|
||||||
|
require
|
||||||
|
no_user_authenticated: api.user = Void
|
||||||
deferred
|
deferred
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user