@@ -267,6 +267,10 @@ private void IncomingHttpRequest(IAsyncResult result)
267267 private async void processRequest ( string path , LoginParams loginParams = null )
268268 {
269269 redirectUrl = this . initParams [ "redirectUrl" ] . ToString ( ) ;
270+ if ( redirectUrl . EndsWith ( "/" ) )
271+ {
272+ redirectUrl = redirectUrl . TrimEnd ( '/' ) ;
273+ }
270274
271275#if UNITY_STANDALONE || UNITY_EDITOR
272276 this . initParams [ "redirectUrl" ] = StartLocalWebserver ( ) ;
@@ -276,6 +280,7 @@ private async void processRequest(string path, LoginParams loginParams = null)
276280#endif
277281
278282 loginParams . redirectUrl = loginParams . redirectUrl ?? new Uri ( this . initParams [ "redirectUrl" ] . ToString ( ) ) ;
283+ //Debug.Log("loginParams.redirectUrl: =>" + loginParams.redirectUrl);
279284 Dictionary < string , object > paramMap = new Dictionary < string , object > ( ) ;
280285 paramMap [ "options" ] = this . initParams ;
281286 paramMap [ "params" ] = loginParams == null ? ( object ) new Dictionary < string , object > ( ) : ( object ) loginParams ;
@@ -332,6 +337,10 @@ public async void launchWalletServices(ChainConfig chainConfig, string path = "w
332337 if ( ! string . IsNullOrEmpty ( sessionId ) )
333338 {
334339 redirectUrl = this . initParams [ "redirectUrl" ] . ToString ( ) ;
340+ if ( redirectUrl . EndsWith ( "/" ) )
341+ {
342+ redirectUrl = redirectUrl . TrimEnd ( '/' ) ;
343+ }
335344 #if UNITY_STANDALONE || UNITY_EDITOR
336345 this . initParams [ "redirectUrl" ] = StartLocalWebserver ( ) ;
337346 redirectUrl = this . initParams [ "redirectUrl" ] . ToString ( ) . Replace ( "/complete/" , "" ) ;
@@ -435,7 +444,6 @@ public void setResultUrl(Uri uri)
435444 this . Enqueue ( ( ) => KeyStoreManagerUtils . savePreferenceData ( KeyStoreManagerUtils . REDIRECT_URL , redirectUrl ) ) ;
436445
437446 //call authorize session API
438- //Debug.Log("redirectUrl: =>" + redirectUrl);
439447 this . Enqueue ( ( ) => authorizeSession ( sessionId , redirectUrl ) ) ;
440448
441449#if ! UNITY_EDITOR && UNITY_WEBGL
@@ -546,6 +554,10 @@ public async void request(ChainConfig chainConfig, string method, JArray request
546554 if ( ! string . IsNullOrEmpty ( sessionId ) )
547555 {
548556 redirectUrl = this . initParams [ "redirectUrl" ] . ToString ( ) ;
557+ if ( redirectUrl . EndsWith ( "/" ) )
558+ {
559+ redirectUrl = redirectUrl . TrimEnd ( '/' ) ;
560+ }
549561 #if UNITY_STANDALONE || UNITY_EDITOR
550562 this . initParams [ "redirectUrl" ] = StartLocalWebserver ( ) ;
551563 redirectUrl = this . initParams [ "redirectUrl" ] . ToString ( ) . Replace ( "/complete/" , "" ) ;
@@ -625,7 +637,6 @@ private void authorizeSession(string newSessionId, string origin)
625637 if ( ! string . IsNullOrEmpty ( sessionId ) )
626638 {
627639 var pubKey = KeyStoreManagerUtils . getPubKey ( sessionId ) ;
628- //Debug.Log("pubKey: =>" + pubKey);
629640 //Debug.Log("origin: =>" + origin);
630641 StartCoroutine ( Web3AuthApi . getInstance ( ) . authorizeSession ( pubKey , origin , ( response =>
631642 {
0 commit comments