Update auth.md

This commit is contained in:
Jonas Dellinger 2017-09-30 23:24:20 +02:00 committed by GitHub
parent 4351d21fd7
commit dcf4eefc61

View File

@ -88,15 +88,15 @@ static void Main(string[] args)
static void auth_OnResponseReceivedEvent(Token token, string state, string error) static void auth_OnResponseReceivedEvent(Token token, string state, string error)
{ {
//stop the http server
auth.StopHttpServer();
var spotify = new SpotifyWebApiClass() var spotify = new SpotifyWebApiClass()
{ {
TokenType = token.TokenType, TokenType = token.TokenType,
AccessToken = token.AccessToken AccessToken = token.AccessToken
}; };
//We can now make calls with the token object //We can now make calls with the token object
//stop the http server
auth.StopHttpServer();
} }
``` ```
@ -138,8 +138,6 @@ static void Main(string[] args)
private static void auth_OnResponseReceivedEvent(AutorizationCodeAuthResponse response) private static void auth_OnResponseReceivedEvent(AutorizationCodeAuthResponse response)
{ {
//Stop the HTTP Server, done.
auth.StopHttpServer();
//NEVER DO THIS! You would need to provide the ClientSecret. //NEVER DO THIS! You would need to provide the ClientSecret.
//You would need to do it e.g via a PHP-Script. //You would need to do it e.g via a PHP-Script.
@ -152,6 +150,9 @@ private static void auth_OnResponseReceivedEvent(AutorizationCodeAuthResponse re
}; };
//With the token object, you can now make API calls //With the token object, you can now make API calls
//Stop the HTTP Server, done.
auth.StopHttpServer();
} }
``` ```