dotMorten / WinUIEx

WinUI Extensions
https://dotmorten.github.io/WinUIEx
MIT License
582 stars 37 forks source link

Unexpected app activation behaviour for WebAuthenticator when referencing NuGet package #96

Closed hansmbakker closed 1 year ago

hansmbakker commented 1 year ago

(moved from #92)

I'm using WinUIEx.WebAuthenticator.AuthenticateAsync(...).

Expected behaviour: When opening the callback url, the app activation should be redirected to the original app instance based on the state that is given with the callback url.

Actual behaviour: When using version 2.1 of WinUIEx (that is - using the NuGet package), a second app instance is still being opened instead of the redirect going to my initial instance. I am seeing that the state is encoded as JSON, which verifies that I'm using version 2.1 (the JSON encoding was new in #92).

When not using the NuGet package, but instead putting these files in my project:

This is probably a mistake on my side, but do you have any hints how I can best debug what is happening inside the NuGet package? It is not possible to put a breakpoint in decompiled code or in unloaded modules (and when the NuGet dll is loaded, the NuGet code is run immediately because of the [System.Runtime.CompilerServices.ModuleInitializer] attribute)

hansmbakker commented 1 year ago

I created a bug repro in https://github.com/hansmbakker/WinUIExWebAuthenticatorBugRepro - hope it reproduces for you.

hansmbakker commented 1 year ago

@dotMorten would you have time to look at my repro?

Mat3oo commented 1 year ago

I have the same problem on MAUI with nuget WinUIEx version 2.1.