Skip to content

OpenID Auth failure when avatar is to big #6212

@BrutalBirdie

Description

@BrutalBirdie

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] }

width={300}
height={300}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions