+7
legit/routes/auth.go
+7
legit/routes/auth.go
···
20
auth, ok := session.Values["authenticated"].(bool)
21
22
if !ok || !auth {
23
+
log.Printf("not logged in, redirecting")
24
http.Redirect(w, r, "/login", http.StatusTemporaryRedirect)
25
return
26
}
···
59
}
60
61
log.Println("successfully refreshed token")
62
+
}
63
+
64
+
if r.URL.Path == "/login" {
65
+
log.Println("already logged in")
66
+
http.Redirect(w, r, "/", http.StatusTemporaryRedirect)
67
+
return
68
}
69
70
next.ServeHTTP(w, r)
+5
-2
legit/routes/handler.go
+5
-2
legit/routes/handler.go
+2
-2
legit/routes/routes.go
+2
-2
legit/routes/routes.go