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