Issue Description
It is currently the case that if your avatar from the OpenID client is too big, the auth fails and reports to the user:
You can't be authenticated. Please contact your administrator.
Error thrown by:
|
Rails.logger.error("Error during authentication: #{e}") |
Related code and files:
|
validates :avatar, |
|
dimension: { width: { in: 1..300 }, height: { in: 1..300 } }, |
|
content_type: Rails.configuration.uploads[:images][:formats], |
|
size: { less_than: Rails.configuration.uploads[:images][:max_size] } |
Suggested Solution
If the avatar size can not be flexible or configurable by the administration, use the default spec/fixtures/files/default-avatar.svg as fallback and inform the user that his avatar was too big, and the fallback was used.
This way the auth does not fail to due to an avatar.
Issue Description
It is currently the case that if your avatar from the OpenID client is too big, the auth fails and reports to the user:
Error thrown by:
greenlight/app/controllers/external_controller.rb
Line 100 in 4f909ee
Related code and files:
greenlight/app/models/user.rb
Lines 60 to 63 in 4d67cd7
greenlight/app/javascript/components/users/user/SetAvatar.jsx
Lines 110 to 111 in 4f909ee
Suggested Solution
If the avatar size can not be flexible or configurable by the administration, use the default spec/fixtures/files/default-avatar.svg as fallback and inform the user that his avatar was too big, and the fallback was used.
This way the auth does not fail to due to an avatar.