Files
MatchLiveTv/backend/app/services/youtube/oauth_url.rb
Emiliano Frascaro 994c1e3c09 Integrazione YouTube Live: OAuth squadra, canale piattaforma Light e UI.
Collegamento da Dettagli squadra e admin per il refresh token Match Live TV; API e app mobile allineate ai piani Light/Full.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-02 19:36:56 +02:00

23 lines
650 B
Ruby

module Youtube
class OauthUrl
AUTH_URL = "https://accounts.google.com/o/oauth2/v2/auth".freeze
SCOPES = [
"https://www.googleapis.com/auth/youtube",
"https://www.googleapis.com/auth/youtube.force-ssl"
].join(" ").freeze
def self.build(state:, redirect_uri: ENV["YOUTUBE_REDIRECT_URI"])
params = {
client_id: ENV.fetch("YOUTUBE_CLIENT_ID", "not_configured"),
redirect_uri: redirect_uri,
response_type: "code",
scope: SCOPES,
access_type: "offline",
prompt: "consent",
state: state
}
"#{AUTH_URL}?#{URI.encode_www_form(params)}"
end
end
end