Repository navigation
fix(auth): replace deprecated url.parse with WHATWG URL in localhost login - #11317
Merged
Merged
Conversation
…login ### Description Replaces the deprecated `url.parse()` call in `loginWithLocalhost` (`src/auth.ts`) with the standard WHATWG `URL` API (`new URL(req.url || "", callbackUrl).searchParams`) to prevent Node.js `[DEP0169] DeprecationWarning` messages during `firebase login`. ### Scenarios Tested - `npm run build` and `npx mocha src/auth.spec.ts` - `firebase login --reauth` local OAuth callback flow without emitting `DEP0169` deprecation warnings ### Sample Commands `firebase login` `firebase login --reauth`
Contributor
There was a problem hiding this comment.
Code Review
This pull request replaces the deprecated url.parse() method with the standard URL API in src/auth.ts to resolve a Node.js deprecation warning during firebase login. Feedback on these changes highlights a potential issue where new URL() can throw a TypeError on malformed input, which could crash the CLI process. It is recommended to wrap the URL parsing in a try/catch block to handle such cases gracefully.
bkendall
enabled auto-merge (squash)
October 20, 2026 18:08
joehan
reviewed
Oct 20, 2026
joehan
approved these changes
Oct 20, 2026
joehan
left a comment
Member
There was a problem hiding this comment.
LGTM after you fix the unhandled error issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replaces the deprecated
url.parse()call inloginWithLocalhost(src/auth.ts) with the standard WHATWGURLAPI (new URL(req.url || "", callbackUrl).searchParams) to prevent Node.js[DEP0169] DeprecationWarningmessages duringfirebase login.Scenarios Tested
npm run buildandnpx mocha src/auth.spec.tsfirebase login --reauthlocal OAuth callback flow without emittingDEP0169deprecation warningsSample Commands
firebase loginfirebase login --reauth