providers/oauth2: ensure refresh tokens are URL safe

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>

#3185
This commit is contained in:
Jens Langhammer 2022-06-30 12:43:04 +02:00
parent a6d3fd92df
commit 983882f5a0
1 changed files with 1 additions and 1 deletions

View File

@ -239,7 +239,7 @@ class OAuth2Provider(Provider):
token = RefreshToken( token = RefreshToken(
user=user, user=user,
provider=self, provider=self,
refresh_token=generate_key(), refresh_token=base64.urlsafe_b64encode(generate_key().encode()).decode(),
expires=timezone.now() + timedelta_from_string(self.token_validity), expires=timezone.now() + timedelta_from_string(self.token_validity),
scope=scope, scope=scope,
) )