feat: misskey auth

This commit is contained in:
sam 2024-12-12 16:44:01 +01:00
parent 51e335f090
commit 77c3047b1e
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
6 changed files with 214 additions and 16 deletions

View file

@ -161,20 +161,13 @@ public class FediverseAuthController(
[FromBody] FediverseCallbackRequest req
)
{
await remoteAuthService.ValidateAddAccountStateAsync(
req.State,
CurrentUser!.Id,
AuthType.Fediverse,
req.Instance
);
FediverseApplication app = await fediverseAuthService.GetApplicationAsync(req.Instance);
FediverseAuthService.FediverseUser remoteUser =
await fediverseAuthService.GetRemoteFediverseUserAsync(app, req.Code);
try
{
AuthMethod authMethod = await authService.AddAuthMethodAsync(
CurrentUser.Id,
CurrentUser!.Id,
AuthType.Fediverse,
remoteUser.Id,
remoteUser.Username,