File tree Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Expand file tree Collapse file tree 1 file changed +1
-9
lines changed Original file line number Diff line number Diff line change @@ -171,25 +171,17 @@ def __repr__(self) -> str:
171
171
def _handle_simple_input_form_generator (f : StateInputStepFunc , authorize_callback : Callable [[OIDCUserModel | None ], bool ] | None = None ) -> StateInputFormGenerator :
172
172
"""Processes f into a form generator and injects a pre-hook for user authorization"""
173
173
def authorize_user_from_state (state : State ) -> None :
174
- logger .error ("authorize_user_from_state: called" )
175
174
user_model = state .pop ("__process_user" , None )
176
175
if user_model is not None :
177
176
user_model = cast (OIDCUserModel , user_model )
178
- else :
179
- logger .error ("authorize_user_from_state: no user model" )
180
177
181
178
if authorize_callback is not None :
182
- logger .error ("authorize_user_from_state: callback found" )
183
179
authorize_callback (user_model )
184
180
if not authorize_callback (user_model ):
185
- logger .error ("authorize_user_from_state: FORBIDDEN" )
186
- #TODO not sure that step name is available here, but could put it on state?
187
181
raise_status (HTTPStatus .FORBIDDEN , "User is not authorized to execute step" )
188
- else :
189
- logger .error ("authorize_user_from_state: no callback!" )
190
182
191
183
if inspect .isgeneratorfunction (f ):
192
- def generator_wrapper (state : State ):
184
+ def generator_wrapper (state : State ) -> Any :
193
185
authorize_user_from_state (state )
194
186
return f (state )
195
187
You can’t perform that action at this time.
0 commit comments