File tree Expand file tree Collapse file tree 4 files changed +8
-15
lines changed Expand file tree Collapse file tree 4 files changed +8
-15
lines changed Original file line number Diff line number Diff line change @@ -108,13 +108,13 @@ public Task<bool> GetEmpty()
108
108
Error = error
109
109
} ) ) ;
110
110
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> ") ;
112
112
}
113
113
114
114
[ WebApiHandler ( HttpVerbs . Post , "/" ) ]
115
115
public async Task < bool > PostValues ( )
116
116
{
117
- Dictionary < string , object > formParams = await this . RequestFormDataDictionaryAsync ( ) ;
117
+ Dictionary < string , object > formParams = await HttpContext . RequestFormDataDictionaryAsync ( ) ;
118
118
119
119
string state = ( string ) formParams [ "state" ] ;
120
120
AuthorizationCodeAuth . Instances . TryGetValue ( state , out SpotifyAuthServer < AuthorizationCode > authServer ) ;
@@ -124,7 +124,7 @@ public async Task<bool> PostValues()
124
124
auth . SecretId = ( string ) formParams [ "secretId" ] ;
125
125
126
126
string uri = auth . GetUri ( ) ;
127
- return this . Redirect ( uri , false ) ;
127
+ return HttpContext . Redirect ( uri , false ) ;
128
128
}
129
129
130
130
public AuthorizationCodeAuthController ( IHttpContext context ) : base ( context )
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ public Task<bool> GetAuth()
29
29
string state = Request . QueryString [ "state" ] ;
30
30
SpotifyAuthServer < Token > auth = ImplicitGrantAuth . GetByState ( state ) ;
31
31
if ( auth == null )
32
- return this . StringResponseAsync (
32
+ return HttpContext . StringResponseAsync (
33
33
$ "Failed - Unable to find auth request with state \" { state } \" - Please retry") ;
34
34
35
35
Token token ;
@@ -55,7 +55,7 @@ public Task<bool> GetAuth()
55
55
}
56
56
57
57
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>" ) ;
59
59
}
60
60
61
61
public ImplicitGrantAuthController ( IHttpContext context ) : base ( context )
Original file line number Diff line number Diff line change 1
1
<Project Sdk =" Microsoft.NET.Sdk" >
2
2
3
3
<PropertyGroup >
4
- <TargetFrameworks >net46 ;netstandard2.0</TargetFrameworks >
4
+ <TargetFrameworks >net462 ;netstandard2.0</TargetFrameworks >
5
5
</PropertyGroup >
6
6
7
7
<PropertyGroup Condition =" '$(Configuration)|$(Platform)'=='Debug|AnyCPU'" >
15
15
</PropertyGroup >
16
16
17
17
<ItemGroup >
18
- <PackageReference Include =" EmbedIO" Version =" 2.2.7 " />
18
+ <PackageReference Include =" EmbedIO" Version =" 2.8.0 " />
19
19
</ItemGroup >
20
20
21
21
<ItemGroup >
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Generic ;
3
- using System . Net ;
4
3
using System . Text ;
5
4
using System . Threading . Tasks ;
6
5
using SpotifyAPI . Web . Enums ;
9
8
using Unosquare . Labs . EmbedIO . Modules ;
10
9
using SpotifyAPI . Web . Models ;
11
10
using Newtonsoft . Json ;
12
- #if NETSTANDARD2_0
13
11
using System . Net . Http ;
14
- #endif
15
- #if NET46
16
- using System . Net . Http ;
17
- using HttpListenerContext = Unosquare . Net . HttpListenerContext ;
18
- #endif
19
12
20
13
namespace SpotifyAPI . Web . Auth
21
14
{
@@ -211,7 +204,7 @@ public Task<bool> GetAuth()
211
204
Code = code ,
212
205
Error = error
213
206
} ) ) ;
214
- return this . HtmlResponseAsync ( ( ( TokenSwapAuth ) auth ) . HtmlResponse ) ;
207
+ return HttpContext . HtmlResponseAsync ( ( ( TokenSwapAuth ) auth ) . HtmlResponse ) ;
215
208
}
216
209
}
217
210
}
You can’t perform that action at this time.
0 commit comments