Hello! I have an issue with account-linking where ...
# support-questions-legacy
l
Hello! I have an issue with account-linking where I need to use the Atlassian token specifically to access their API. When 2 accounts are linked using auto account-linking and i try to get the accessTokenPayload in the createNewSession override, how do I tell which is the Atlassian and which is say Google? This is my backend config session override:
Copy code
Session.init({
            override: {
                functions: (originalImplementation) => {
                    return {
                        ...originalImplementation,
                        createNewSession: async function (input) {
                            let userId = input.userId;

                            try {
                                let userInfo = await supertokens.getUser(userId);

                                console.log(userInfo)
                                // This goes in the access token, and is availble to read on the frontend.
                                input.accessTokenPayload = {
                                    ...input.accessTokenPayload,
                                    email: userInfo.emails[0]
                                };
                            } catch (err) {
                                console.log({ err });
                            }

                            return originalImplementation.createNewSession(input);
                        },
                    };
                },
            },
        }),
8 Views