Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/brown-trains-melt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@firebase/auth": patch
---

Fix issue where using signInWithRedirect in Firebase Studio required a route rewrite for the auth handler widget.
10 changes: 9 additions & 1 deletion packages/auth/src/core/util/handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,15 @@ export async function _getRedirectUrl(

function getHandlerBase({ config }: AuthInternal): string {
if (!config.emulator) {
return `https://${config.authDomain}/${WIDGET_PATH}`;
const path = `https://${config.authDomain}/${WIDGET_PATH}`;
if (
typeof process !== 'undefined' &&
process.env.FIREBASE_USE_HANDLER_EXT
) {
// Static servers require extensions to infer Content-Type
return `${path}.html`;
}
return path;
}

return _emulatorUrl(config, EMULATOR_WIDGET_PATH);
Expand Down
Loading