I'm trying to get user name and surname following this section of the guide https://supertokens.com...
n
I'm trying to get user name and surname following this section of the guide https://supertokens.com/docs/thirdparty/common-customizations/get-user-info where I should be able to access data with
Copy code
override: {
                functions: (originalImplementation) => {
                    return {
                        ...originalImplementation,
                        // override the thirdparty sign in / up API
                        signInUp: async function(input) {
                            // TODO: Some pre sign in / up logic

                            let response = await originalImplementation.signInUp(input);

                            if (response.status === "OK") {
                                // This is the response from the OAuth tokens provided by the third party provider
                                let accessToken = response.oAuthTokens["access_token"];
                                // other tokens like the refresh_token or id_token are also 
                                // available in the oAuthTokens object.

                                // This gives the user's info as returned by the provider's user profile endpoint.
                                let firstName = response.rawUserInfoFromProvider.fromUserInfoAPI!["first_name"];

                                // This gives the user's info from the returned ID token 
                                // if the provider gave us an ID token
                                let lastName = response.rawUserInfoFromProvider.fromUserInfoAPI!["last_name"];
                            }

                            return response;
                        }
                    }
                }
            }
in the ThirdPartyEmailPassword.init() function in config.ts provided by the pre build code. Once here, what am I supposed to do to get name and surname? store it in metadata and then retrieve them through an api call?
r
hey @nik2208.2208 yea, that could be one option.. it;s really up to you
n
how should I do that? should I call
await UserMetadata.updateUserMetadata(userId, { name: fistName });
within that function? If yes, where do I get session/user data to make the call?
r
see the response object
n
the response object is exactly the same whether I add or not the piece of code I reported above
16 Views