Skip to content

Commit

Permalink
Fixed custom domain magic login
Browse files Browse the repository at this point in the history
  • Loading branch information
kurtisassad committed Nov 20, 2024
1 parent 2071f2c commit bceca47
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -367,9 +367,15 @@ export async function startLoginWithMagicLink({
localStorage.setItem('magic_provider', provider!);
localStorage.setItem('magic_chain', chain!);
localStorage.setItem('magic_redirect_to', window.location.href);

let redirectURI = new URL('/finishsociallogin', window.location.origin)
.href;
if (process.env.APP_ENV === 'production') {
redirectURI = 'https://commonwealth.im/finishsociallogin';
}
await magic.oauth2.loginWithRedirect({
provider,
redirectURI: new URL('/finishsociallogin', window.location.origin).href,
redirectURI,
});

// magic should redirect away from this page, but we return after 5 sec if it hasn't
Expand Down

0 comments on commit bceca47

Please sign in to comment.