Skip to content
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

feat: autofill name field on OAuth signup #6147

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

jjinendra3
Copy link
Contributor

Proposed Changes

This PR enhances the OAuth signup experience by including the profile scope in Google OAuth, ensuring that user's name is retrieved correctly. Additionally, it extends the fix to other OAuth providers, pre-filling the name field on SetUsernameView when available. This aligns with the future scope outlined in the previous PR.

Issue(s)

How to Test or Reproduce

  1. Sign up using any OAuth provider.
  2. After successful authentication and 2FA (if enabled), you'll be redirected to SetUsernameView.
  3. The name field will now be pre-filled if the OAuth provider provides this information, allowing users to modify it as needed.

Screenshots

(Test Flow with a New Email ID to Simulate OAuth Signup)

Types of Changes

  • Bugfix (non-breaking change that fixes an issue)
  • Improvement (non-breaking change that enhances an existing function)
  • New feature (non-breaking change that adds functionality)
  • Documentation update

Checklist

Further Comments

This update builds upon the previous fix, streamlining the OAuth signup flow by ensuring that user details are retrieved and pre-filled when available. If an OAuth provider does not return a name, the fallback of manually entering it remains in place.

Let me know if there's anything specific you'd like to adjust or improve! 🚀🚀

@diegolmello diegolmello changed the title feat: autofilling the name field on oAuth Signup feat: autofill name field on OAuth signup Feb 24, 2025
@@ -49,7 +49,7 @@ export const onPressGoogle = ({ service, server }: IServiceLogin) => {
const { clientId } = service;
const endpoint = 'https://accounts.google.com/o/oauth2/auth';
const redirect_uri = `${server}/_oauth/google?close`;
const scope = 'email';
const scope = encodeURIComponent('profile email');
Copy link
Member

Choose a reason for hiding this comment

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

It's virtually the same, but if you do 'email,profile' (with the comma) like it was mentioned here, you won't need encodeURIComponent

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hey @diegolmello , thanks for the reply!

So, my first attempt was to use 'profile,email' as suggested, but it didn't work. Then, I tried 'email,profile', but that didn't work either.

However, encodeURIComponent("profile email") translates to "profile%20email", which is accepted by Google OAuth. Below are the screenshots demonstrating this behavior.

('profile,email')
('email,profile')
(encodeURIComponent("profile email"))

Please lmk your thoughts on this!🚀 :)

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.

bug: Missing Name Prompt for New Users Signing in via Google Auth
2 participants