8000 fix: handle external URLs in avatar rendering (#23) by lvuur-godaddy · Pull Request #32 · kanbn/kan · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: handle external URLs in avatar rendering (#23) #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 5, 2025

Conversation

lvuur-godaddy
Copy link
Contributor

Fixes #23

Description

Fixed a bug where Google OAuth avatars were not displaying correctly in the settings page. When a user creates an account with Google OAuth, the avatar URL is a full Google URL, but our getAvatarUrl function was prepending our storage bucket path, resulting in broken image links.

Changes Made

- Updated `getAvatarUrl` function in `apps/web/src/utils/helpers.ts` to detect full URLs
- Added conditional logic to return URLs as-is when they start with `http://` or `https://`
- Renamed parameter from `key` to `imageOrKey` for better clarity
- Maintains backward compatibility with existing S3 key usage

Copy link
Contributor
@hjball hjball left a comment

Choose a reason for hiding this comment

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

Good start, I think you'll need to update the remotePatterns in the next config to allow lh3.googleusercontent.com domains

https://nextjs.org/docs/app/getting-started/images#remote-images

@LovelessCodes
Copy link
Contributor

Good start, I think you'll need to update the remotePatterns in the next config to allow lh3.googleusercontent.com domains

nextjs.org/docs/app/getting-started/images#remote-images

Is Google the only provider you'll support, going forward?
If it is, it's fine doing it this way, if not maybe consider #28 instead.

@hjball
Copy link
Contributor
hjball commented Jun 5, 2025

Good start, I think you'll need to update the remotePatterns in the next config to allow lh3.googleusercontent.com domains
nextjs.org/docs/app/getting-started/images#remote-images

Is Google the only provider you'll support, going forward? If it is, it's fine doing it this way, if not maybe consider #28 instead.

For the time being, yes, but this is a quick win for users who have already signed up. We should be uploading all provider avatars to s3 going forward (like you've proposed in #28).

@hjball hjball changed the title fix: issue 23, handle external URLs in avatar rendering fix: handle external URLs in avatar rendering (#23) Jun 5, 2025
@hjball
Copy link
Contributor
hjball commented Jun 5, 2025

Good start, I think you'll need to update the remotePatterns in the next config to allow lh3.googleusercontent.com domains

https://nextjs.org/docs/app/getting-started/images#remote-images

The error is clogging up my logs so I've pushed up the changes @lvuur-godaddy

@kanbn kanbn deleted a comment from vercel bot Jun 5, 2025
@hjball hjball merged commit f88bd82 into kanbn:main Jun 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

User avatar images set by Google OAuth do not load
3 participants
0