Unverified Commit 4fd62939 authored by Yukai Huang's avatar Yukai Huang Committed by GitHub
Browse files

Merge pull request #1490 from alphagov/fix-avatars

parents 662bb872 e1977a1d
...@@ -115,10 +115,11 @@ module.exports = function (sequelize, DataTypes) { ...@@ -115,10 +115,11 @@ module.exports = function (sequelize, DataTypes) {
else photo += '?size=bigger' else photo += '?size=bigger'
break break
case 'github': case 'github':
if (profile.photos && profile.photos[0]) photo = profile.photos[0].value.replace('?', '') const photoURL = new URL(profile.photos && profile.photos[0]
else photo = 'https://avatars.githubusercontent.com/u/' + profile.id ? profile.photos[0].value
if (bigger) photo += '?s=400' : `https://avatars.githubusercontent.com/u/${profile.id}`)
else photo += '?s=96' photoURL.searchParams.set('s', bigger ? 400 : 96)
photo = photoURL.toString()
break break
case 'gitlab': case 'gitlab':
photo = profile.avatarUrl photo = profile.avatarUrl
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment