← All requests
0

Fetch and store Google profile pictures in Kaneo avatar storage on sign-in

OpenAuthenticationAndreas Michael ·

Summary

When signing in with Google, automatically fetch the user's Google profile picture and store it in Kaneo's built-in avatar storage (/api/user/avatar/:id).

Motivation

  • Existing accounts that sign in with Google (for example, accounts originally created via email verification code or password) do not automatically get their Google profile picture set.
  • Storing the fetched image in Kaneo's user_avatar storage (/api/user/avatar/:id) rather than referencing an external googleusercontent.com URL keeps avatars self-contained in the database, avoids external third-party image requests/rate limits, and works consistently across web and mobile clients.

Proposed behavior

  • On Google sign-in (and account linking), extract the picture URL from the Google ID token (falling back to Google's OIDC userinfo endpoint if omitted).
  • Download and validate the image (HTTPS Google avatar host check, size limit, and MIME/magic-byte validation) and store it in user_avatar.
  • Update the stored Google avatar on subsequent Google sign-ins if the picture has changed, without rotating the avatar ID when the image bytes are unchanged.
  • Never overwrite a custom avatar that the user manually uploaded in Kaneo settings.

Discussion 0

No comments yet.

Sign in to comment.

Keyboard shortcuts

Anywhere

Go to requests
gh
Go to changelog
gc
Go to notifications
gn
Next or previous page
norp
Leave a text field or close a menu
Esc
Show this list
?

Requests

Move to the next or previous request
jork
Open the selected request
oorEnter
Vote on the selected request
v
Search
/
New request
c

Request

Vote
v
Write a comment
c
Edit
e