Skip to content

Commit

Permalink
Unable to retrieve photo if the photo
Browse files Browse the repository at this point in the history
This can occur when the profile photo comes from the AD
  • Loading branch information
johan-smits authored Dec 10, 2020
1 parent e7b0a86 commit 2c726df
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/omniauth/strategies/microsoft_office365.rb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def avatar_file
rescue ::OAuth2::Error => e
if e.response.status == 404 # User has no avatar...
return nil
elsif e.response.status == 403 # Permissions are not allowed or the profile photo is from a local AD
nil
elsif e.code['code'] == 'GetUserPhoto' && e.code['message'].match('not supported')
nil
else
Expand Down

0 comments on commit 2c726df

Please sign in to comment.