Skip to content

Commit a15e71c

Browse files
authored
Fix implicit grant Spotify.Web.Auth example in docs (JohnnyCrazy#465)
The previous example was not functioning due to mistakes and unresolved references, unfortunately. Fixed login request response type, a typo and URI to open in browser. Now it compiles and works properly (tested).
1 parent 7e9bd85 commit a15e71c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎SpotifyAPI.Docs/docs/implicit_grant.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,16 @@ public static async Task Main()
8888
_server = new EmbedIOAuthServer(new Uri("http://localhost:5000/callback"), 5000);
8989
await _server.Start();
9090

91-
_server.ImplictGrantReceived += OnImplictGrantReceived;
91+
_server.ImplictGrantReceived += OnImplicitGrantReceived;
9292

93-
var request = new LoginRequest(_server.BaseUri, "ClientId", LoginRequest.ResponseType.Code)
93+
var request = new LoginRequest(_server.BaseUri, "ClientId", LoginRequest.ResponseType.Token)
9494
{
9595
Scope = new List<string> { Scopes.UserReadEmail }
9696
};
97-
BrowserUtil.Open(uri);
97+
BrowserUtil.Open(request.ToUri());
9898
}
9999

100-
private static async Task OnImplictGrantReceived(object sender, ImplictGrantResponse response)
100+
private static async Task OnImplicitGrantReceived(object sender, ImplictGrantResponse response)
101101
{
102102
await _server.Stop();
103103
var spotify = new SpotifyClient(response.AccessToken);

0 commit comments

Comments
 (0)