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:
Nicola Murino
2021-11-13 13:25:43 +01:00
parent b331dc5686
commit 78233ff9a3
25 changed files with 1787 additions and 60 deletions

View File

@@ -12,6 +12,11 @@ func (e *ValidationError) Error() string {
return fmt.Sprintf("Validation error: %s", e.err)
}
// GetErrorString returns the unmodified error string
func (e *ValidationError) GetErrorString() string {
return e.err
}
// NewValidationError returns a validation errors
func NewValidationError(error string) *ValidationError {
return &ValidationError{
@@ -19,7 +24,7 @@ func NewValidationError(error string) *ValidationError {
}
}
// RecordNotFoundError raised if a requested user is not found
// RecordNotFoundError raised if a requested object is not found
type RecordNotFoundError struct {
err string
}
@@ -53,3 +58,19 @@ func NewMethodDisabledError(error string) *MethodDisabledError {
err: error,
}
}
// GenericError raised for not well categorized error
type GenericError struct {
err string
}
func (e *GenericError) Error() string {
return e.err
}
// NewGenericError returns a generic error
func NewGenericError(error string) *GenericError {
return &GenericError{
err: error,
}
}