Skip to content

Commit dcf4eef

Browse files
authored
Update auth.md
1 parent 4351d21 commit dcf4eef

File tree

1 file changed

+6
-5
lines changed
  • SpotifyAPI.Docs/docs/SpotifyWebAPI

1 file changed

+6
-5
lines changed

SpotifyAPI.Docs/docs/SpotifyWebAPI/auth.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,15 @@ static void Main(string[] args)
8888
8989
static void auth_OnResponseReceivedEvent(Token token, string state, string error)
9090
{
91-
//stop the http server
92-
auth.StopHttpServer();
93-
9491
var spotify = new SpotifyWebApiClass()
9592
{
9693
TokenType = token.TokenType,
9794
AccessToken = token.AccessToken
9895
};
9996
//We can now make calls with the token object
97+
98+
//stop the http server
99+
auth.StopHttpServer();
100100
}
101101
```
102102

@@ -138,8 +138,6 @@ static void Main(string[] args)
138138
139139
private static void auth_OnResponseReceivedEvent(AutorizationCodeAuthResponse response)
140140
{
141-
//Stop the HTTP Server, done.
142-
auth.StopHttpServer();
143141
144142
//NEVER DO THIS! You would need to provide the ClientSecret.
145143
//You would need to do it e.g via a PHP-Script.
@@ -152,6 +150,9 @@ private static void auth_OnResponseReceivedEvent(AutorizationCodeAuthResponse re
152150
};
153151
154152
//With the token object, you can now make API calls
153+
154+
//Stop the HTTP Server, done.
155+
auth.StopHttpServer();
155156
}
156157
```
157158

0 commit comments

Comments
 (0)