diff --git a/backend/app/controllers/youtube_oauth_callback_controller.rb b/backend/app/controllers/youtube_oauth_callback_controller.rb index 9de6548..69e8a33 100644 --- a/backend/app/controllers/youtube_oauth_callback_controller.rb +++ b/backend/app/controllers/youtube_oauth_callback_controller.rb @@ -1,7 +1,5 @@ # Callback OAuth YouTube (HTML). Non usare Api::V1 — ActionController::API non renderizza le view. class YoutubeOauthCallbackController < ActionController::Base - layout "admin" - def show return redirect_to_oauth_error("Codice OAuth mancante") if params[:code].blank? @@ -11,7 +9,7 @@ class YoutubeOauthCallbackController < ActionController::Base if ctx[:kind] == :platform @refresh_token = tokens[:refresh_token] @channel_title = tokens[:channel_title] - return render "admin/youtube/platform_token" + return render "admin/youtube/platform_token", layout: false end user = User.find(ctx[:user_id]) diff --git a/backend/app/views/admin/youtube/platform_token.html.erb b/backend/app/views/admin/youtube/platform_token.html.erb index a52bc10..f3f2d3b 100644 --- a/backend/app/views/admin/youtube/platform_token.html.erb +++ b/backend/app/views/admin/youtube/platform_token.html.erb @@ -1,15 +1,43 @@ -

Token canale Match Live TV

+ + + + + + + Token YouTube — Match Live TV + + + +
+

Token canale Match Live TV

-<% if @channel_title.present? %> -

Canale: <%= @channel_title %>

-<% end %> + <% if @channel_title.present? %> +

Canale: <%= @channel_title %>

+ <% end %> -<% if @refresh_token.present? %> -

Aggiungi in /opt/matchlivetv/infra/.env (o locale infra/.env):

-
YOUTUBE_PLATFORM_REFRESH_TOKEN=<%= @refresh_token %>
-

Copia ora: non verrà mostrato di nuovo. Poi riavvia il container Rails.

-<% else %> -

Google non ha restituito un refresh token. Ripeti il collegamento con prompt=consent (revoca l’accesso precedente in Google Account).

-<% end %> + <% if @refresh_token.present? %> +

Collegamento riuscito. Copia subito questa riga:

+

Aggiungi in /opt/matchlivetv/infra/.env:

+
YOUTUBE_PLATFORM_REFRESH_TOKEN=<%= @refresh_token %>
+

Non verrà mostrato di nuovo. Poi: docker compose -f docker-compose.prod.yml restart rails sidekiq

+ <% else %> +

+ Google non ha restituito un refresh token. In + account Google → accesso app + revoca «Match Live TV», poi ripeti da + /admin/youtube/platform. +

+ <% end %> -

<%= link_to "← Dashboard admin", admin_root_path %>

+

← Dashboard admin

+
+ +