mirror of
https://github.com/Luzifer/cloudkeys-go.git
synced 2024-11-08 14:10:05 +00:00
Fix: On register the username needs to be treated like in login
This commit is contained in:
parent
1b66ad4b8a
commit
38c7390ddd
1 changed files with 2 additions and 1 deletions
|
@ -4,6 +4,7 @@ import (
|
|||
"crypto/sha1"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/flosch/pongo2"
|
||||
"github.com/gorilla/sessions"
|
||||
|
@ -11,7 +12,7 @@ import (
|
|||
|
||||
func registerHandler(res http.ResponseWriter, r *http.Request, session *sessions.Session, ctx *pongo2.Context) (*string, error) {
|
||||
var (
|
||||
username = r.FormValue("username")
|
||||
username = strings.ToLower(r.FormValue("username"))
|
||||
password = r.FormValue("password")
|
||||
passwordCheck = r.FormValue("password_repeat")
|
||||
hashedPassword = fmt.Sprintf("%x", sha1.Sum([]byte(cfg.PasswordSalt+password)))
|
||||
|
|
Loading…
Reference in a new issue