sources/oauth: correctly concatenate URLs to allow custom parameters to be included

closes #3374

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2022-08-08 21:17:10 +02:00
parent 6356ddd9f3
commit 4c9878313c
6 changed files with 33 additions and 40 deletions

View File

@ -228,9 +228,9 @@ class User(SerializerModel, GuardianUserMixin, AbstractUser):
return DEFAULT_AVATAR
if mode.startswith("attributes."):
return get_path_from_dict(self.attributes, mode[11:], default=DEFAULT_AVATAR)
# gravatar uses md5 for their URLs, so md5 can't be avoided
mail_hash = md5(self.email.lower().encode("utf-8")).hexdigest() # nosec
if mode == "gravatar":
# gravatar uses md5 for their URLs, so md5 can't be avoided
parameters = [
("s", "158"),
("r", "g"),