From d6bf98b30eca2d65aecfbcbdda942d0238f4d175 Mon Sep 17 00:00:00 2001 From: Markos Gogoulos Date: Sun, 28 Dec 2025 15:47:26 +0200 Subject: [PATCH] this --- lti/adapters.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lti/adapters.py b/lti/adapters.py index 2038040d..bee45aa4 100644 --- a/lti/adapters.py +++ b/lti/adapters.py @@ -151,6 +151,13 @@ class DjangoSessionService: print(f"Nonce {nonce} is valid and marked as used", flush=True) return True + def set_state_valid(self, state, id_token_hash): + """Mark state as valid and associate it with the id_token_hash""" + state_key = f'state-{state}' + print(f"Setting state valid: state={state}, id_token_hash={id_token_hash}", flush=True) + self.save_launch_data(state_key, {'valid': True, 'id_token_hash': id_token_hash}) + return True + def get_cookie(self, key): """Get cookie value (for cookie service compatibility)""" return self.request.COOKIES.get(key)