From a15e71c8156842999b2416d8daa6ef338d7bd393 Mon Sep 17 00:00:00 2001 From: Ilya Burakov Date: Sat, 20 Jun 2020 22:32:34 +0500 Subject: [PATCH] Fix implicit grant Spotify.Web.Auth example in docs (#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). --- SpotifyAPI.Docs/docs/implicit_grant.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SpotifyAPI.Docs/docs/implicit_grant.md b/SpotifyAPI.Docs/docs/implicit_grant.md index 850d991f..0443f88f 100644 --- a/SpotifyAPI.Docs/docs/implicit_grant.md +++ b/SpotifyAPI.Docs/docs/implicit_grant.md @@ -88,16 +88,16 @@ public static async Task Main() _server = new EmbedIOAuthServer(new Uri("http://localhost:5000/callback"), 5000); await _server.Start(); - _server.ImplictGrantReceived += OnImplictGrantReceived; + _server.ImplictGrantReceived += OnImplicitGrantReceived; - var request = new LoginRequest(_server.BaseUri, "ClientId", LoginRequest.ResponseType.Code) + var request = new LoginRequest(_server.BaseUri, "ClientId", LoginRequest.ResponseType.Token) { Scope = new List { Scopes.UserReadEmail } }; - BrowserUtil.Open(uri); + BrowserUtil.Open(request.ToUri()); } -private static async Task OnImplictGrantReceived(object sender, ImplictGrantResponse response) +private static async Task OnImplicitGrantReceived(object sender, ImplictGrantResponse response) { await _server.Stop(); var spotify = new SpotifyClient(response.AccessToken);