Skip to content

Commit

Permalink
Merge pull request #10317 from hicommonwealth/release/v1.7.6-x
Browse files Browse the repository at this point in the history
v1.7.6-3: Fixed sso login for custom domains
  • Loading branch information
ilijabojanovic authored Dec 16, 2024
2 parents 8b5cc89 + 974ae19 commit a0f3399
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,12 @@ export async function handleSocialLoginCallback({
bearer,
chain,
walletSsoSource,
isCustomDomain,
}: {
bearer?: string | null;
chain?: string;
walletSsoSource?: string;
isCustomDomain?: boolean;
}): Promise<{ address: string }> {
// desiredChain may be empty if social login was initialized from
// a page without a chain, in which case we default to an eth login
Expand Down Expand Up @@ -476,7 +478,9 @@ export async function handleSocialLoginCallback({
magicAddress = utils.getAddress(metadata.publicAddress);
}
} else {
const result = await magic.oauth2.getRedirectResult();
const result = isCustomDomain
? await magic.oauth.getRedirectResult()
: await magic.oauth2.getRedirectResult();

if (!bearer) {
console.log('No bearer token found in magic redirect result');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ const validate = async (
// @ts-expect-error <StrictNullChecks/>
walletSsoSource,
isLoggedIn,
isCustomDomain,
});

if (isMagicV1) {
Expand Down

0 comments on commit a0f3399

Please sign in to comment.