:drunk: AI trying to fix bugs
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user