Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
update token format and use new token api
Browse files Browse the repository at this point in the history
  • Loading branch information
aspriddell committed Dec 27, 2022
1 parent 2624f7b commit 3bff02c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class Dragon6Token : IUbisoftToken
/// <summary>
/// App-Id must be set client side.
/// </summary>
[JsonProperty("appId")]
[JsonProperty("app_id")]
public string AppId { get; set; }

[JsonProperty("token")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ public Dragon6DeveloperClient(string clientId, string clientSecret, string scope

protected override async Task<IUbisoftToken> GetToken(UbisoftService service, string sessionId)
{
// todo change request based on service
var token = await PerformAsync<Dragon6Token>(new Dragon6TokenRequest()).ConfigureAwait(false);
token.AppId = UbisoftService.NewStatsSite.AppId();

return token;
return await PerformAsync<Dragon6Token>(new Dragon6TokenRequest(service)).ConfigureAwait(false);
}

internal async ValueTask<DragonFruitClientCredentials> RequestDragonFruitAccessToken()
Expand Down
14 changes: 13 additions & 1 deletion DragonFruit.Six.Api/Services/Developer/Dragon6TokenRequest.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,22 @@
// Dragon6 API Copyright DragonFruit Network <inbox@dragonfruit.network>
// Licensed under Apache-2. Refer to the LICENSE file for more info

using DragonFruit.Data;
using DragonFruit.Data.Parameters;
using DragonFruit.Six.Api.Enums;

namespace DragonFruit.Six.Api.Services.Developer
{
public class Dragon6TokenRequest : Dragon6DeveloperApiRequest
{
public override string Path => "https://dragon6.dragonfruit.network/api/v2/dev/token";
public override string Path => "https://dragon6.dragonfruit.network/api/v3/token/raw";

public Dragon6TokenRequest(UbisoftService service)
{
Service = service;
}

[QueryParameter("appid", EnumHandlingMode.StringLower)]
public UbisoftService Service { get; }
}
}

0 comments on commit 3bff02c

Please sign in to comment.