Reset password to sorta-sensical string
This resets user password to something random that also reminds the user they should change it immediately after logging in, instead of a completely random jumble of characters. Ref T695
This commit is contained in:
parent
6d4ec0b17d
commit
f673f9b562
2
admin.go
2
admin.go
@ -246,7 +246,7 @@ func handleAdminResetUserPass(app *App, u *User, w http.ResponseWriter, r *http.
|
|||||||
return impart.HTTPError{http.StatusFound, "/admin/users"}
|
return impart.HTTPError{http.StatusFound, "/admin/users"}
|
||||||
}
|
}
|
||||||
// Generate new random password since none supplied
|
// Generate new random password since none supplied
|
||||||
pass := passgen.New()
|
pass := passgen.NewWordish()
|
||||||
hashedPass, err := auth.HashPass([]byte(pass))
|
hashedPass, err := auth.HashPass([]byte(pass))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return impart.HTTPError{http.StatusInternalServerError, fmt.Sprintf("Could not create password hash: %v", err)}
|
return impart.HTTPError{http.StatusInternalServerError, fmt.Sprintf("Could not create password hash: %v", err)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user