Skip to content

Commit dd249e0

Browse files
authored
Merge e88a2f3 into b97eab3
2 parents b97eab3 + e88a2f3 commit dd249e0

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.changeset/brown-trains-melt.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@firebase/auth": patch
3+
---
4+
5+
Fix issue where using signInWithRedirect in Firebase Studio required a route rewrite for the auth handler widget.

packages/auth/src/core/util/handler.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,15 @@ export async function _getRedirectUrl(
129129

130130
function getHandlerBase({ config }: AuthInternal): string {
131131
if (!config.emulator) {
132-
return `https://${config.authDomain}/${WIDGET_PATH}`;
132+
const path = `https://${config.authDomain}/${WIDGET_PATH}`;
133+
if (
134+
typeof process !== 'undefined' &&
135+
process.env.FIREBASE_USE_HANDLER_EXT
136+
) {
137+
// Static servers require extensions to infer Content-Type
138+
return `${path}.html`;
139+
}
140+
return path;
133141
}
134142

135143
return _emulatorUrl(config, EMULATOR_WIDGET_PATH);

0 commit comments

Comments
 (0)