Skip to content

fix(auth): replace deprecated url.parse with WHATWG URL in localhost login - #11317

Merged
bkendall merged 6 commits into
mainfrom
bkend/fix-auth-url-parse
Oct 20, 2026
Merged

bkendall merged 6 commits into
mainfrom
bkend/fix-auth-url-parse

Conversation

@bkendall

Copy link
Copy Markdown
Contributor

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

…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`
@bkendall
bkendall requested a review from joehan October 20, 2026 18:00

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/auth.ts Resolved
@bkendall
bkendall enabled auto-merge (squash) October 20, 2026 18:08

@joehan joehan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AiIfindings:

Comment thread src/auth.ts Resolved
Comment thread src/auth.ts Resolved

@joehan joehan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM after you fix the unhandled error issue

@bkendall
bkendall merged commit adedf43 into main Oct 20, 2026
51 checks passed
@bkendall
bkendall deleted the bkend/fix-auth-url-parse branch October 20, 2026 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants