admin: add manual "Send Password reset" to accounts tab

Only appears with Reset links enabled.
Pressing this sends a PWR link to the users selected.
if one user is selected, or if one of you selected users doesn't have a
method of contact, a link is given to the admin to send to them
manually.
This commit is contained in:
Harvey Tindall
2021-10-13 15:04:22 +01:00
parent 9ae16163bb
commit eeb9b07bce
41 changed files with 349 additions and 84 deletions
+19
View File
@@ -1,5 +1,7 @@
package main
import "time"
type stringResponse struct {
Response string `json:"response" example:"message"`
Error string `json:"error" example:"errorDescription"`
@@ -320,3 +322,20 @@ type ResetPasswordDTO struct {
PIN string `json:"pin"`
Password string `json:"password"`
}
type AdminPasswordResetDTO struct {
Users []string `json:"users"` // List of Jellyfin user IDs
}
type AdminPasswordResetRespDTO struct {
Link string `json:"link"` // Only returned if one of the given users doesn't have a contact method set, or only one user was requested.
Manual bool `json:"manual"` // Whether or not the admin has to send the link manually or not.
}
// InternalPWR stores a local version of a password reset PIN used for resets triggered by the admin when reset links are enabled.
type InternalPWR struct {
PIN string `json:"pin"`
Username string `json:"username"`
ID string `json:"id"`
Expiry time.Time `json:"expiry"`
}