We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 662bb87 + e1977a1 commit 4fd6293Copy full SHA for 4fd6293
lib/models/user.js
@@ -115,10 +115,11 @@ module.exports = function (sequelize, DataTypes) {
115
else photo += '?size=bigger'
116
break
117
case 'github':
118
- if (profile.photos && profile.photos[0]) photo = profile.photos[0].value.replace('?', '')
119
- else photo = 'https://avatars.githubusercontent.com/u/' + profile.id
120
- if (bigger) photo += '?s=400'
121
- 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)
122
+ photo = photoURL.toString()
123
124
case 'gitlab':
125
photo = profile.avatarUrl
0 commit comments