feat: link fediverse account to existing user
This commit is contained in:
parent
03209e4028
commit
57e1ec09c0
17 changed files with 335 additions and 95 deletions
|
@ -63,13 +63,14 @@ public static class KeyCacheExtensions
|
|||
this KeyCacheService keyCacheService,
|
||||
AuthType authType,
|
||||
Snowflake userId,
|
||||
string? instance = null,
|
||||
CancellationToken ct = default
|
||||
)
|
||||
{
|
||||
var state = AuthUtils.RandomToken();
|
||||
await keyCacheService.SetKeyAsync(
|
||||
$"add_account:{state}",
|
||||
new AddExtraAccountState(authType, userId),
|
||||
new AddExtraAccountState(authType, userId, instance),
|
||||
Duration.FromDays(1),
|
||||
ct
|
||||
);
|
||||
|
@ -93,4 +94,4 @@ public record RegisterEmailState(
|
|||
[property: JsonProperty(NullValueHandling = NullValueHandling.Ignore)] Snowflake? ExistingUserId
|
||||
);
|
||||
|
||||
public record AddExtraAccountState(AuthType AuthType, Snowflake UserId);
|
||||
public record AddExtraAccountState(AuthType AuthType, Snowflake UserId, string? Instance = null);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue