Skip to content

Commit cfd985e

Browse files
committed
Tidy up string handling in util/handler.ts
1 parent 587f993 commit cfd985e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const EMULATOR_WIDGET_PATH = 'emulator/auth/handler';
4545
*
4646
* @internal
4747
*/
48-
const FIREBASE_APP_CHECK_FRAGMENT_ID = 'fac';
48+
const FIREBASE_APP_CHECK_FRAGMENT_ID = encodeURIComponent('fac');
4949

5050
// eslint-disable-next-line @typescript-eslint/consistent-type-definitions
5151
type WidgetParams = {
@@ -118,9 +118,7 @@ export async function _getRedirectUrl(
118118
// Sets the App Check token to pass to the widget
119119
const appCheckToken = await auth._getAppCheckToken();
120120
const appCheckTokenFragment = appCheckToken
121-
? encodeURIComponent(FIREBASE_APP_CHECK_FRAGMENT_ID) +
122-
'=' +
123-
encodeURIComponent(appCheckToken)
121+
? `${FIREBASE_APP_CHECK_FRAGMENT_ID}=${encodeURIComponent(appCheckToken)}`
124122
: '';
125123

126124
return `${getHandlerBase(auth)}?${querystring(paramsDict).slice(

0 commit comments

Comments
 (0)