1- using System . Net ;
1+ using System ;
2+ using System . Net ;
23using System . Threading . Tasks ;
34using SpotifyAPI . Web . Enums ;
45using SpotifyAPI . Web . Models ;
@@ -18,20 +19,22 @@ public ImplictGrantAuth(string clientId, string redirectUri, string serverUri, S
1819
1920 protected override WebServer AdaptWebServer ( WebServer webServer )
2021 {
21- return webServer . WithWebApiController < ImplictGrantAuthController > ( ) ;
22+ Console . WriteLine ( "Hello" ) ;
23+ webServer . Module < WebApiModule > ( ) . RegisterController < ImplictGrantAuthController > ( ) ;
24+ return webServer ;
2225 }
2326 }
2427
2528 public class ImplictGrantAuthController : WebApiController
2629 {
27- [ WebApiHandler ( HttpVerbs . Get , "/auth " ) ]
28- public Task < bool > GetAuth ( WebServer server , HttpListenerContext context )
30+ [ WebApiHandler ( HttpVerbs . Get , "/authe " ) ]
31+ public bool GetAuth ( WebServer server , HttpListenerContext context )
2932 {
3033 string state = context . Request . QueryString [ "state" ] ;
3134 SpotifyAuthServer < Token > auth = ImplictGrantAuth . GetByState ( state ) ;
3235 if ( auth == null )
33- return context . StringResponseAsync (
34- $ "Failed - Unable to find auth request with state \" { state } \" - Please retry") ;
36+ return true ; /* context.StringResponseAsync(
37+ $"Failed - Unable to find auth request with state \"{state}\" - Please retry");*/
3538
3639 Token token ;
3740 string error = context . Request . QueryString [ "error" ] ;
@@ -56,7 +59,8 @@ public Task<bool> GetAuth(WebServer server, HttpListenerContext context)
5659 }
5760
5861 Task . Factory . StartNew ( ( ) => auth ? . TriggerAuth ( token ) ) ;
59- return context . StringResponseAsync ( "OK - This window can be closed now" ) ;
62+ return true ;
63+ // return context.StringResponseAsync("OK - This window can be closed now");
6064 }
6165 }
62- }
66+ }
0 commit comments