File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -108,13 +108,13 @@ public Task<bool> GetEmpty()
108108 Error = error
109109 } ) ) ;
110110
111- return this . StringResponseAsync ( " OK - This window can be closed now") ;
111+ return HttpContext . HtmlResponseAsync ( "<html><script type= \" text/javascript \" >window.close();</script> OK - This window can be closed now</html> ") ;
112112 }
113113
114114 [ WebApiHandler ( HttpVerbs . Post , "/" ) ]
115115 public async Task < bool > PostValues ( )
116116 {
117- Dictionary < string , object > formParams = await this . RequestFormDataDictionaryAsync ( ) ;
117+ Dictionary < string , object > formParams = await HttpContext . RequestFormDataDictionaryAsync ( ) ;
118118
119119 string state = ( string ) formParams [ "state" ] ;
120120 AuthorizationCodeAuth . Instances . TryGetValue ( state , out SpotifyAuthServer < AuthorizationCode > authServer ) ;
@@ -124,7 +124,7 @@ public async Task<bool> PostValues()
124124 auth . SecretId = ( string ) formParams [ "secretId" ] ;
125125
126126 string uri = auth . GetUri ( ) ;
127- return this . Redirect ( uri , false ) ;
127+ return HttpContext . Redirect ( uri , false ) ;
128128 }
129129
130130 public AuthorizationCodeAuthController ( IHttpContext context ) : base ( context )
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public Task<bool> GetAuth()
2929 string state = Request . QueryString [ "state" ] ;
3030 SpotifyAuthServer < Token > auth = ImplicitGrantAuth . GetByState ( state ) ;
3131 if ( auth == null )
32- return this . StringResponseAsync (
32+ return HttpContext . StringResponseAsync (
3333 $ "Failed - Unable to find auth request with state \" { state } \" - Please retry") ;
3434
3535 Token token ;
@@ -55,7 +55,7 @@ public Task<bool> GetAuth()
5555 }
5656
5757 Task . Factory . StartNew ( ( ) => auth . TriggerAuth ( token ) ) ;
58- return this . StringResponseAsync ( "<html><script type=\" text/javascript\" >window.close();</script>OK - This window can be closed now</html>" ) ;
58+ return HttpContext . HtmlResponseAsync ( "<html><script type=\" text/javascript\" >window.close();</script>OK - This window can be closed now</html>" ) ;
5959 }
6060
6161 public ImplicitGrantAuthController ( IHttpContext context ) : base ( context )
Original file line number Diff line number Diff line change 11<Project Sdk =" Microsoft.NET.Sdk" >
22
33 <PropertyGroup >
4- <TargetFrameworks >net46 ;netstandard2.0</TargetFrameworks >
4+ <TargetFrameworks >net462 ;netstandard2.0</TargetFrameworks >
55 </PropertyGroup >
66
77 <PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='Debug|AnyCPU'" >
1515 </PropertyGroup >
1616
1717 <ItemGroup >
18- <PackageReference Include =" EmbedIO" Version =" 2.2.7 " />
18+ <PackageReference Include =" EmbedIO" Version =" 2.8.0 " />
1919 </ItemGroup >
2020
2121 <ItemGroup >
Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3- using System . Net ;
43using System . Text ;
54using System . Threading . Tasks ;
65using SpotifyAPI . Web . Enums ;
98using Unosquare . Labs . EmbedIO . Modules ;
109using SpotifyAPI . Web . Models ;
1110using Newtonsoft . Json ;
12- #if NETSTANDARD2_0
1311using System . Net . Http ;
14- #endif
15- #if NET46
16- using System . Net . Http ;
17- using HttpListenerContext = Unosquare . Net . HttpListenerContext ;
18- #endif
1912
2013namespace SpotifyAPI . Web . Auth
2114{
@@ -211,7 +204,7 @@ public Task<bool> GetAuth()
211204 Code = code ,
212205 Error = error
213206 } ) ) ;
214- return this . HtmlResponseAsync ( ( ( TokenSwapAuth ) auth ) . HtmlResponse ) ;
207+ return HttpContext . HtmlResponseAsync ( ( ( TokenSwapAuth ) auth ) . HtmlResponse ) ;
215208 }
216209 }
217210}
You can’t perform that action at this time.
0 commit comments