mirror of
https://github.com/Luzifer/cloudkeys-go.git
synced 2024-11-09 22:50:05 +00:00
Merge branch 'master' of github.com:Luzifer/cloudkeys-go
This commit is contained in:
commit
7a0f9e22ba
2 changed files with 8 additions and 1 deletions
|
@ -1,4 +1,10 @@
|
||||||
|
|
||||||
|
1.2.2 / 2015-08-01
|
||||||
|
==================
|
||||||
|
|
||||||
|
* Fix: On register the username needs to be treated like in login
|
||||||
|
* Fixed numbering in README
|
||||||
|
|
||||||
1.2.1 / 2015-07-31
|
1.2.1 / 2015-07-31
|
||||||
==================
|
==================
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import (
|
||||||
"crypto/sha1"
|
"crypto/sha1"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/flosch/pongo2"
|
"github.com/flosch/pongo2"
|
||||||
"github.com/gorilla/sessions"
|
"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) {
|
func registerHandler(res http.ResponseWriter, r *http.Request, session *sessions.Session, ctx *pongo2.Context) (*string, error) {
|
||||||
var (
|
var (
|
||||||
username = r.FormValue("username")
|
username = strings.ToLower(r.FormValue("username"))
|
||||||
password = r.FormValue("password")
|
password = r.FormValue("password")
|
||||||
passwordCheck = r.FormValue("password_repeat")
|
passwordCheck = r.FormValue("password_repeat")
|
||||||
hashedPassword = fmt.Sprintf("%x", sha1.Sum([]byte(cfg.PasswordSalt+password)))
|
hashedPassword = fmt.Sprintf("%x", sha1.Sum([]byte(cfg.PasswordSalt+password)))
|
||||||
|
|
Loading…
Reference in a new issue