Fix Auth info
Some checks failed
Build and Push Image / build-and-push (push) Has been cancelled

This commit is contained in:
2025-07-06 01:43:14 -04:00
parent bc8a4414cd
commit 76be6dc8e7

View File

@@ -16,7 +16,7 @@ using System.Text.Json.Serialization;
namespace AobaServer.Services; namespace AobaServer.Services;
public class AobaRpcService(AobaService aobaService, AccountsService accountsService, AuthInfo authInfo) : AobaRpc.AobaRpcBase public class AobaRpcService(AobaService aobaService, AccountsService accountsService, AuthConfigService authConfig) : AobaRpc.AobaRpcBase
{ {
public override async Task<MediaResponse> GetMedia(Id request, ServerCallContext context) public override async Task<MediaResponse> GetMedia(Id request, ServerCallContext context)
{ {
@@ -37,6 +37,7 @@ public class AobaRpcService(AobaService aobaService, AccountsService accountsSer
var user = await accountsService.GetUserAsync(userId, context.CancellationToken); var user = await accountsService.GetUserAsync(userId, context.CancellationToken);
if (user == null) if (user == null)
return new ShareXResponse { Error = "User does not exist" }; return new ShareXResponse { Error = "User does not exist" };
var authInfo = await authConfig.GetDefaultAuthInfoAsync();
var token = user.GetToken(authInfo); var token = user.GetToken(authInfo);
var dest = new ShareXDestination var dest = new ShareXDestination
{ {