Commit e2f7d88
authored
fix: userinfo: avoid indexing by None user_id in stateless mode (#46)
In stateless mode, `user_id` passed to `get_claims_for` is always `None`.
When no claims are available and userinfo is thus also `None`, `user_id`
is used as index to self._db, but that triggers a `KeyError: None`.
As `create_access_token` populates `user_info` field in `authz_info`
only of `user_info` is pythonically `True`, `user_info` passed here ends
up being `None`, not empty dict `{}`.
As the `Userinfo` class does not have access to `Provider.stateless`,
the easiest fix is to make the db lookup conditional on user_id being
pythonically True - which corresponds with not being in stateltess mode.1 parent 28964c5 commit e2f7d88
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
0 commit comments