users: huge cleanup/dedupe, interface-based third-party services
shared "newUser" method is now "NewUserPostVerification", and is shared between all routes which create a jellyfin account. The new "NewUserFromInvite", "NewUserFromAdmin" and "NewUserFromConfirmationKey" are smaller as a result. Discord, Telegram, and Matrix now implement the "ContactMethodLinker" and "ContactMethodUser" interfaces, meaning code is shared a lot between them in the NewUser methods, and the specifics are now in their own files. Ombi/Jellyseerr similarly implement a simpler interface "ThirdPartyService", which simply has ImportUser and AddContactMethod routes. Note these new interface methods are only used for user creation as of yet, but could likely be used in other places.
This commit is contained in:
@@ -31,7 +31,7 @@ type newUserDTO struct {
|
||||
|
||||
type newUserResponse struct {
|
||||
User bool `json:"user" binding:"required"` // Whether user was created successfully
|
||||
Email bool `json:"email"` // Whether welcome email was successfully sent (always true if feature is disabled
|
||||
Email bool `json:"email"` // Whether welcome email was successfully sent (always true if feature is disabled)
|
||||
Error string `json:"error"` // Optional error message.
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user