mirror of
https://github.com/status-im/fathom.git
synced 2025-03-01 03:20:27 +00:00
check errors returned by sessionstoreE
This commit is contained in:
parent
54edd87d00
commit
e2d45dbc40
@ -70,7 +70,11 @@ var LogoutHandler = HandlerFunc(func(w http.ResponseWriter, r *http.Request) err
|
|||||||
/* middleware */
|
/* middleware */
|
||||||
func Authorize(next http.Handler) http.Handler {
|
func Authorize(next http.Handler) http.Handler {
|
||||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||||
session, _ := store.Get(r, "auth")
|
session, err := store.Get(r, "auth")
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
userID, ok := session.Values["user_id"]
|
userID, ok := session.Values["user_id"]
|
||||||
|
|
||||||
if session.IsNew || !ok {
|
if session.IsNew || !ok {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user