feat: add some fediverse authentication code
* create applications on instances * generate authorize URLs * exchange oauth code for token and user info (untested) * recreate mastodon app on authentication failure
This commit is contained in:
parent
a4ca0902a3
commit
0077a165b5
8 changed files with 497 additions and 0 deletions
|
@ -14,6 +14,15 @@ public class FoxnounsError(string message, Exception? inner = null) : Exception(
|
|||
|
||||
public class UnknownEntityError(Type entityType, Exception? inner = null)
|
||||
: DatabaseError($"Entity of type {entityType.Name} not found", inner);
|
||||
|
||||
public class RemoteAuthError(string message, string? errorBody = null, Exception? inner = null)
|
||||
: FoxnounsError(message, inner)
|
||||
{
|
||||
public string? ErrorBody => errorBody;
|
||||
|
||||
public override string ToString() =>
|
||||
$"{Message}: {ErrorBody} {(Inner != null ? $"({Inner})" : "")}";
|
||||
}
|
||||
}
|
||||
|
||||
public class ApiError(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue