Redirect to Last.fm and receive a token (unused)

This commit is contained in:
Claudio Ortolina
2025-05-05 19:19:12 +01:00
parent 9e458b07df
commit 7c547f2d80
6 changed files with 27 additions and 0 deletions
@@ -0,0 +1,7 @@
defmodule MusicLibraryWeb.LastFmController do
use MusicLibraryWeb, :controller
def callback(conn, %{"token" => _token}) do
conn |> redirect(to: ~p"/")
end
end
@@ -35,5 +35,8 @@
</button>
</div>
</.form>
<a href={LastFm.auth_url()} class="flex items-center justify-center">
Connect to Last.fm
</a>
</div>
</div>
+2
View File
@@ -29,6 +29,8 @@ defmodule MusicLibraryWeb.Router do
get "/login", SessionController, :new
post "/sessions/create", SessionController, :create
get "/auth/last_fm/callback", LastFmController, :callback
scope "/" do
pipe_through :logged_in