Skip to content
This repository was archived by the owner on Jun 19, 2025. It is now read-only.

FEATURE: retrieve user avatar #6

Merged
merged 2 commits into from
Apr 8, 2025
Merged

FEATURE: retrieve user avatar #6

merged 2 commits into from
Apr 8, 2025

Conversation

ZogStriP
Copy link
Member

@ZogStriP ZogStriP commented Apr 7, 2025

Also add specs.

Internal ref - t/150933

@ZogStriP ZogStriP requested review from pmusaraj and Copilot April 7, 2025 15:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

@@ -18,7 +18,7 @@ class DiscourseLoginClientStrategy < ::OmniAuth::Strategies::OAuth2
username: access_token.params["info"]["username"],
name: access_token.params["info"]["username"],
email: access_token.params["info"]["email"],
# image: for avatar?
image: access_token.params["info"]["image"],
Copy link
Preview

Copilot AI Apr 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider adding a fallback mechanism for cases when the 'image' key is missing in access_token.params["info"] to avoid returning nil and potentially causing issues in downstream code.

Suggested change
image: access_token.params["info"]["image"],
image: access_token.params["info"].fetch("image", ""),

Copilot uses AI. Check for mistakes.

Copy link
Contributor

@pmusaraj pmusaraj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks!

@ZogStriP ZogStriP merged commit c209952 into main Apr 8, 2025
4 checks passed
@ZogStriP ZogStriP deleted the retrieve-user-avatar branch April 8, 2025 16:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants