Development 2
This commit is contained in:
@@ -26,8 +26,7 @@ namespace FoxTube
|
||||
{
|
||||
#region Static Information
|
||||
public static NetworkCredential EmailCredential { get => new NetworkCredential("youwillneverknowthisadress@gmail.com", "thisisthepassword12345"); }
|
||||
private static string YoutubeApi { get => "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0"; }
|
||||
private static string ApplicationName { get => "FoxTube"; }
|
||||
public static SecretsVault Vault { get => Methods.MainPage.Vault; }
|
||||
private static ClientSecrets Secrets
|
||||
{
|
||||
get => new ClientSecrets()
|
||||
@@ -36,14 +35,14 @@ namespace FoxTube
|
||||
ClientSecret = "BkVZOAaCU2Zclf0Zlicg6y2_"
|
||||
};
|
||||
}
|
||||
public static bool IsAuthorized { get => Methods.MainPage.Vault.IsLoged; }
|
||||
public static bool IsAuthorized { get => Vault.IsLoged; }
|
||||
|
||||
public static YouTubeService NoAuthService
|
||||
{
|
||||
get => new YouTubeService(new BaseClientService.Initializer()
|
||||
{
|
||||
ApiKey = YoutubeApi,
|
||||
ApplicationName = ApplicationName
|
||||
ApiKey = "AIzaSyBgHrCnrlzlVmk0cJKL8RqP9Y8x6XSuk_0",
|
||||
ApplicationName = "FoxTube"
|
||||
});
|
||||
}
|
||||
|
||||
@@ -51,8 +50,8 @@ namespace FoxTube
|
||||
{
|
||||
get => new YouTubeService(new BaseClientService.Initializer()
|
||||
{
|
||||
HttpClientInitializer = Methods.MainPage.Vault.Credential,
|
||||
ApplicationName = ApplicationName
|
||||
HttpClientInitializer = Vault.Credential,
|
||||
ApplicationName = "FoxTube"
|
||||
});
|
||||
}
|
||||
#endregion
|
||||
@@ -70,8 +69,6 @@ namespace FoxTube
|
||||
|
||||
public async Task Authorize()
|
||||
{
|
||||
|
||||
|
||||
Credential = await GoogleWebAuthorizationBroker.AuthorizeAsync(Secrets, new[] { Google.Apis.Oauth2.v2.Oauth2Service.Scope.UserinfoProfile, YouTubeService.Scope.YoutubeForceSsl }, "user", CancellationToken.None);
|
||||
AuthorizationStateChanged.Invoke(this, null);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user