Skip to content

Guard against undefined verificationUri and userCode in device code flow#7172

Draft
eschoeller wants to merge 3 commits intopnp:mainfrom
eschoeller:fix/device-code-null-check
Draft

Guard against undefined verificationUri and userCode in device code flow#7172
eschoeller wants to merge 3 commits intopnp:mainfrom
eschoeller:fix/device-code-null-check

Conversation

@eschoeller
Copy link
Copy Markdown

Summary

  • Add null check on response.verificationUri before calling browserUtil.open() in processDeviceCodeCallback
  • Add null check on response.userCode before calling clipboardy.writeSync()

Both crash with TypeError when the MSAL DeviceCodeResponse does not populate these fields and autoOpenLinksInBrowser or copyDeviceCodeToClipboard are enabled.

Closes #7167

@Adam-it
Copy link
Copy Markdown
Member

Adam-it commented Apr 3, 2026

@eschoeller thanks for openning the PR but lets keep it draft for now since I cannot seem to be able to reporduce the bug you described

@Adam-it Adam-it marked this pull request as draft April 3, 2026 21:06
@Adam-it Adam-it self-assigned this Apr 3, 2026
@eschoeller
Copy link
Copy Markdown
Author

Oh sure, that's a good idea. Should have I sent it as a draft initially? I haven't been able to actually use the CLI much yet - waiting on my org to enable a few more things .. but I did encounter this issue. I'd be happy to test it again, perhaps it's been fixed somehow now. It was well over a week ago when I stumbled into it the first time at this point.

I have a few more fixes/features queued up too.

Thanks!

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.

Bug report: Device code login crashes when autoOpenLinksInBrowser is enabled

2 participants