[UNITY] [WEBGL] login success but onLogin not firing

Version Details:
web3auth SDK version: v2.1.1
Unity Editor version: 2023.1.3f1
Build Platform: WebGL

I can login to web3 wallet successfully but after I logged in I received this url to unity editor: http://localhost:50159/auth/?code=state=&b64Params=eyJzZXNzaW9uSWQiOiIwM2M3ZDdjYzk4ZWUxZThjMmUxMDhmZWZmMWM0N2Q3N2VlYmQxZTRmMjg5Y2IyYThmMmEwMDY2Mjk5MzJmNjI5In0
the problem here is the redirect url does not have sessionId key so when editor receive it then the event onLogin cannot be fired.
I tested unity sample unity-auth0-sample that I realize the redirect url must be like this to fire event onLogin: http://localhost:50423/complete/#sessionId=f3cd1ca13099a9370ce5bee082594b21c0bb455b98b378d773aaa5dfd83e57fa&sessionNamespace=&state=

please help me fix this problem

@gianty.hungvt Welcome Aboard!

Your request has been forwarded to our Dev team and we will get back with further updates.

1 Like

hi @gianty.hungvt,

I will try to help you. Can you share with us your github repository or your code.

Thanks

Hi Tom,
sorry I cannot share the code with you but I implemented an workaround here.
I realized that b64Params actually contains sessionId so I added custom logic to setResultUrl function.
If the url already contain sessionId then it will go to normal flow
If the url contains b64Params then I will decode base64 string and get back a json with sessionId info, then run normal logic flow in that function

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.