-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
fix: add Name field to SetUsernameView #6144
Conversation
I think this change might not cover the ideal scenario, so please test it. IIRC SetUsernameView is only going be called when the backend was not able to use the username informed during register. Since the goal of this task is to fill Name correctly, this PR is aiming to fix the edge case, not the main flow. @jjinendra3 Can you test and confirm this? It's been a long time since this flow was written in this app. Thanks! |
Hey @diegolmello, I tested this in two ways:
(Entire Flow Test When Signing up using OAuth) Conclusion:
Thanks for your patience and guidance—it means a lot! |
@jjinendra3 Merged. Thanks for your contribution! |
The name is loaded properly when logging in with google on the web client, but not on mobile. I compared the code of both and noticed that the web client requests both I would try changing the scope here to |
@jjinendra3 can you try that? 🔝 |
Proposed changes
Asks the name from the user during signup using Social Auth so to not leave the name slot empty.
Issue(s)
#6138
How to test or reproduce
Screenshots
Types of changes
Checklist
Further comments
I thoroughly debugged the SocialOAuth flow, checking all params in sdk.ts and all auth related functions such as login() [connect.ts], loginTOTP() [connect.ts], also tracing requests and their responses from and to @rocket.chat/sdk, and verifying backend auth routes. I found that in the result.me section (screenshot), key values like name and username are coming as undefined, seemingly from the
@rocket.chat/sdk
.To cross-check, I tried calling users.wholeInfo with users.getUsernameSuggestion to check the user details there, but since the backend doesn’t store name from Social OAuth, it doesn’t return anything substantial.
I also analyzed how the web client handles this and found that it doesn’t rely on the SDK but has a different embedded indigenous auth system.
After 15+ test signups and deletions in the React Native app analyzing each through different methods, I couldn’t automate fetching the name.
So, as a fix, I propose adding a controlled text input below the username field in app/views/SetUsernameView.tsx, allowing users to enter their name manually. This can be further improved by introducing a
users.getNameSuggestion
route, similar togetUsernameSuggestion
, both of which can be called in the existing useEffect to enhance UX while keeping flexibility for users to modify their name.Let me know if I’ve missed something or if there’s a better approach. Thanks!