From 4401912fcd0c50f37152264a0f4100450f878135 Mon Sep 17 00:00:00 2001 From: luolu Date: Fri, 20 May 2022 12:37:14 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20fix=20oatuh2=20request=20?= =?UTF-8?q?tenant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- oauth2_provider/views/base.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/oauth2_provider/views/base.py b/oauth2_provider/views/base.py index bbd22c4bf..908f65977 100644 --- a/oauth2_provider/views/base.py +++ b/oauth2_provider/views/base.py @@ -205,6 +205,13 @@ def check_token(self, request, *args, **kwargs): if token: if not token.user.is_active: return False + + if not request.tenant: + return False + + request.user = token.user + request.user.tenant = request.tenant + if token.expired(tenant=request.tenant): return False user = token.user