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>
23 lines
650 B
Ruby
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
|