From f1cc9c8d26c096b7ffee83fae5aae6c1249e7bf8 Mon Sep 17 00:00:00 2001 From: Tiphaine LAURENT <25824254+TiphaineLAURENT@users.noreply.github.com> Date: Tue, 3 May 2022 16:39:24 +0200 Subject: OAuth2Error: Allow falsy values as state The idea is to allow values like `0` to be used a state. The current implementation only checks for truthiness. --- oauthlib/oauth2/rfc6749/errors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/oauthlib/oauth2/rfc6749/errors.py b/oauthlib/oauth2/rfc6749/errors.py index da24fea..6fcb751 100644 --- a/oauthlib/oauth2/rfc6749/errors.py +++ b/oauthlib/oauth2/rfc6749/errors.py @@ -60,7 +60,7 @@ class OAuth2Error(Exception): self.response_type = request.response_type self.response_mode = request.response_mode self.grant_type = request.grant_type - if not state: + if state is None: self.state = request.state else: self.redirect_uri = None -- cgit v1.2.1