:drunk: AI trying to fix bugs

This commit is contained in:
2025-07-06 21:15:30 +08:00
parent 3391c08c04
commit 7d1f096e87
70 changed files with 681 additions and 66945 deletions

View File

@ -6,6 +6,8 @@ using DysonNetwork.Pass.Storage;
using NodaTime;
using DysonNetwork.Pass.Data;
using DysonNetwork.Common.Models;
using Account = DysonNetwork.Common.Models.Account;
using AccountConnection = DysonNetwork.Common.Models.AccountConnection;
namespace DysonNetwork.Pass.Features.Auth.OpenId;
@ -27,21 +29,24 @@ public class ConnectionController(
[HttpGet]
public async Task<ActionResult<List<AccountConnection>>> GetConnections()
{
if (HttpContext.Items["CurrentUser"] is not Models.Account currentUser)
if (HttpContext.Items["CurrentUser"] is not Account currentUser)
return Unauthorized();
var connections = await db.AccountConnections
.Where(c => c.AccountId == currentUser.Id)
.Select(c => new
.Select(c => new AccountConnection
{
c.Id,
c.AccountId,
c.Provider,
c.ProvidedIdentifier,
c.Meta,
c.LastUsedAt,
c.CreatedAt,
c.UpdatedAt,
Id = c.Id,
AccountId = c.AccountId,
Provider = c.Provider,
ProvidedIdentifier = c.ProvidedIdentifier,
DisplayName = c.DisplayName,
AccessToken = c.AccessToken,
RefreshToken = c.RefreshToken,
ExpiresAt = c.ExpiresAt,
LastUsedAt = c.LastUsedAt,
CreatedAt = c.CreatedAt,
UpdatedAt = c.UpdatedAt
})
.ToListAsync();
return Ok(connections);