Skip to content

Commit

Permalink
allow http redirect for localhost testing
Browse files Browse the repository at this point in the history
  • Loading branch information
bhparijat committed Nov 15, 2023
1 parent ebc694a commit 736118b
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/auth/src/core/util/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,11 @@ export async function _getRedirectUrl(

function getHandlerBase({ config }: AuthInternal): string {
if (!config.emulator) {
return `https://${config.authDomain}/${WIDGET_PATH}`;
const isLocalhost = config.authDomain?.split(':')[0] === 'localhost';
return (
(isLocalhost ? 'http' : 'https') +
`://${config.authDomain}/${WIDGET_PATH}`
);
}

return _emulatorUrl(config, EMULATOR_WIDGET_PATH);
}

0 comments on commit 736118b

Please sign in to comment.