Removing debug fmt
Cette révision appartient à :
Parent
891e385939
révision
d35c495d59
1 fichiers modifiés avec 2 ajouts et 5 suppressions
|
@ -11,7 +11,6 @@ import (
|
||||||
"github.com/gorilla/context"
|
"github.com/gorilla/context"
|
||||||
"github.com/gorilla/securecookie"
|
"github.com/gorilla/securecookie"
|
||||||
"golang.org/x/crypto/bcrypt"
|
"golang.org/x/crypto/bcrypt"
|
||||||
"fmt"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
@ -124,9 +123,7 @@ func RegisterHandler(w http.ResponseWriter, r *http.Request) (int, error) {
|
||||||
func CurrentUser(r *http.Request) (model.User, error) {
|
func CurrentUser(r *http.Request) (model.User, error) {
|
||||||
var user model.User
|
var user model.User
|
||||||
var encoded string
|
var encoded string
|
||||||
if r == nil {
|
|
||||||
fmt.Println("ERROR r is terminated")
|
|
||||||
}
|
|
||||||
encoded = r.Header.Get("X-Auth-Token")
|
encoded = r.Header.Get("X-Auth-Token")
|
||||||
if len(encoded) == 0 {
|
if len(encoded) == 0 {
|
||||||
// check cookie instead
|
// check cookie instead
|
||||||
|
@ -168,4 +165,4 @@ func getUserFromContext(r *http.Request) model.User {
|
||||||
}
|
}
|
||||||
func setUserToContext(r *http.Request, val model.User) {
|
func setUserToContext(r *http.Request, val model.User) {
|
||||||
context.Set(r, UserContextKey, val)
|
context.Set(r, UserContextKey, val)
|
||||||
}
|
}
|
||||||
|
|
Référencer dans un nouveau ticket