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

Merge pull request #1490 from alphagov/fix-avatars

parents 662bb872 e1977a1d
......@@ -115,10 +115,11 @@ module.exports = function (sequelize, DataTypes) {
else photo += '?size=bigger'
break
case 'github':
if (profile.photos && profile.photos[0]) photo = profile.photos[0].value.replace('?', '')
else photo = 'https://avatars.githubusercontent.com/u/' + profile.id
if (bigger) photo += '?s=400'
else photo += '?s=96'
const photoURL = new URL(profile.photos && profile.photos[0]
? profile.photos[0].value
: `https://avatars.githubusercontent.com/u/${profile.id}`)
photoURL.searchParams.set('s', bigger ? 400 : 96)
photo = photoURL.toString()
break
case 'gitlab':
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