mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-07 14:50:55 +03:00
web UI/REST API: add password reset
In order to reset the password from the admin/client user interface, an SMTP configuration must be added and the user/admin must have an email address. You can prohibit the reset functionality on a per-user basis by using a specific restriction. Fixes #597
This commit is contained in:
32
httpd/web.go
32
httpd/web.go
@@ -16,17 +16,21 @@ const (
|
||||
redactedSecret = "[**redacted**]"
|
||||
csrfFormToken = "_form_token"
|
||||
csrfHeaderToken = "X-CSRF-TOKEN"
|
||||
templateCommonDir = "common"
|
||||
templateTwoFactor = "twofactor.html"
|
||||
templateTwoFactorRecovery = "twofactor-recovery.html"
|
||||
templateForgotPassword = "forgot-password.html"
|
||||
templateResetPassword = "reset-password.html"
|
||||
)
|
||||
|
||||
type loginPage struct {
|
||||
CurrentURL string
|
||||
Version string
|
||||
Error string
|
||||
CSRFToken string
|
||||
StaticURL string
|
||||
AltLoginURL string
|
||||
CurrentURL string
|
||||
Version string
|
||||
Error string
|
||||
CSRFToken string
|
||||
StaticURL string
|
||||
AltLoginURL string
|
||||
ForgotPwdURL string
|
||||
}
|
||||
|
||||
type twoFactorPage struct {
|
||||
@@ -38,6 +42,22 @@ type twoFactorPage struct {
|
||||
RecoveryURL string
|
||||
}
|
||||
|
||||
type forgotPwdPage struct {
|
||||
CurrentURL string
|
||||
Error string
|
||||
CSRFToken string
|
||||
StaticURL string
|
||||
Title string
|
||||
}
|
||||
|
||||
type resetPwdPage struct {
|
||||
CurrentURL string
|
||||
Error string
|
||||
CSRFToken string
|
||||
StaticURL string
|
||||
Title string
|
||||
}
|
||||
|
||||
func getSliceFromDelimitedValues(values, delimiter string) []string {
|
||||
result := []string{}
|
||||
for _, v := range strings.Split(values, delimiter) {
|
||||
|
||||
Reference in New Issue
Block a user